24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ |
27 */ |
28 |
28 |
|
29 // TODO: this file is a freeloader, I should probably get rid of it |
|
30 |
29 #include <stdlib.h> |
31 #include <stdlib.h> |
30 #include <stdio.h> |
32 #include <stdio.h> |
31 #include "Main.h" |
33 #include "Main.h" |
32 #include "String.h" |
34 #include "String.h" |
33 #include "Events.h" |
35 #include "Events.h" |
34 #include "Lexer.h" |
36 #include "Lexer.h" |
35 |
37 |
36 static List<EventDefinition*> gEvents; |
38 static List<EventDefinition*> g_Events; |
37 |
39 |
38 // ============================================================================ |
40 // ============================================================================ |
39 // |
41 // |
40 void AddEvent (EventDefinition* e) |
42 void addEvent (EventDefinition* e) |
41 { |
43 { |
42 gEvents << e; |
44 g_Events << e; |
43 } |
45 } |
44 |
46 |
45 // ============================================================================ |
47 // ============================================================================ |
46 // |
48 // |
47 // Finds an event definition by index |
49 // Finds an event definition by index |
48 // |
50 // |
49 EventDefinition* FindEventByIndex (int idx) |
51 EventDefinition* findEventByIndex (int idx) |
50 { |
52 { |
51 return gEvents[idx]; |
53 return g_Events[idx]; |
52 } |
54 } |
53 |
55 |
54 // ============================================================================ |
56 // ============================================================================ |
55 // |
57 // |
56 // Finds an event definition by name |
58 // Finds an event definition by name |
57 // |
59 // |
58 EventDefinition* FindEventByName (String a) |
60 EventDefinition* findEventByName (String a) |
59 { |
61 { |
60 for (EventDefinition* e : gEvents) |
62 for (EventDefinition* e : g_Events) |
61 if (a.ToUppercase() == e->name.ToUppercase()) |
63 if (a.toUppercase() == e->name.toUppercase()) |
62 return e; |
64 return e; |
63 |
65 |
64 return null; |
66 return null; |
65 } |
67 } |