-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathstringswitch_impl_lcm_cmdcandamage.c
63 lines (62 loc) · 2.39 KB
/
stringswitch_impl_lcm_cmdcandamage.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
typedef enum {
stringswitch_enumerator_default_member_name(lcm_cmdcandamage),
stringswitch_enumerator_member_name(lcm_cmdcandamage, npc),
stringswitch_enumerator_member_name(lcm_cmdcandamage, shot),
stringswitch_enumerator_member_name(lcm_cmdcandamage, enemy),
stringswitch_enumerator_member_name(lcm_cmdcandamage, player),
stringswitch_enumerator_member_name(lcm_cmdcandamage, ground),
stringswitch_enumerator_member_name(lcm_cmdcandamage, obstacle),
} stringswitch_enumerator_name(lcm_cmdcandamage);
static int stringswitch_enumerator_eval_func(lcm_cmdcandamage) (char* str, size_t l) {
switch(l) {
case 3:
if(str[0]!='n') goto main_default;
if(str[1]!='p') goto main_default;
if(str[2]!='c') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, npc);
case 4:
if(str[0]!='s') goto main_default;
if(str[1]!='h') goto main_default;
if(str[2]!='o') goto main_default;
if(str[3]!='t') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, shot);
case 5:
if(str[0]!='e') goto main_default;
if(str[1]!='n') goto main_default;
if(str[2]!='e') goto main_default;
if(str[3]!='m') goto main_default;
if(str[4]!='y') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, enemy);
case 6:
switch(str[0]) {
case 'p':
if(str[1]!='l') goto main_default;
if(str[2]!='a') goto main_default;
if(str[3]!='y') goto main_default;
if(str[4]!='e') goto main_default;
if(str[5]!='r') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, player);
case 'g':
if(str[1]!='r') goto main_default;
if(str[2]!='o') goto main_default;
if(str[3]!='u') goto main_default;
if(str[4]!='n') goto main_default;
if(str[5]!='d') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, ground);
default: goto main_default;
}
case 8:
if(str[0]!='o') goto main_default;
if(str[1]!='b') goto main_default;
if(str[2]!='s') goto main_default;
if(str[3]!='t') goto main_default;
if(str[4]!='a') goto main_default;
if(str[5]!='c') goto main_default;
if(str[6]!='l') goto main_default;
if(str[7]!='e') goto main_default;
return stringswitch_enumerator_member_name(lcm_cmdcandamage, obstacle);
default:
main_default:
return stringswitch_enumerator_default_member_name(lcm_cmdcandamage);
}
}