src/events.cpp

changeset 134
eca2fc0acaa2
parent 133
dbbdb870c835
child 135
8b9132fea327
equal deleted inserted replaced
133:dbbdb870c835 134:eca2fc0acaa2
33 #include "main.h" 33 #include "main.h"
34 #include "string.h" 34 #include "string.h"
35 #include "events.h" 35 #include "events.h"
36 #include "lexer.h" 36 #include "lexer.h"
37 37
38 static List<EventDefinition*> g_Events; 38 static List<EventDefinition*> Events;
39 39
40 // ============================================================================ 40 // ============================================================================
41 // 41 //
42 void addEvent (EventDefinition* e) 42 void addEvent (EventDefinition* e)
43 { 43 {
44 g_Events << e; 44 Events << e;
45 } 45 }
46 46
47 // ============================================================================ 47 // ============================================================================
48 // 48 //
49 // Finds an event definition by index 49 // Finds an event definition by index
50 // 50 //
51 EventDefinition* findEventByIndex (int idx) 51 EventDefinition* findEventByIndex (int idx)
52 { 52 {
53 return g_Events[idx]; 53 return Events[idx];
54 } 54 }
55 55
56 // ============================================================================ 56 // ============================================================================
57 // 57 //
58 // Finds an event definition by name 58 // Finds an event definition by name
59 // 59 //
60 EventDefinition* findEventByName (String a) 60 EventDefinition* findEventByName (String a)
61 { 61 {
62 for (EventDefinition* e : g_Events) 62 for (EventDefinition* e : Events)
63 {
63 if (a.toUppercase() == e->name.toUppercase()) 64 if (a.toUppercase() == e->name.toUppercase())
64 return e; 65 return e;
66 }
65 67
66 return null; 68 return null;
67 } 69 }

mercurial