From 89c88b34696f3d2c98dcb95510e06d92678599f9 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 10 Mar 2013 21:34:40 -0400 Subject: [PATCH] change InputEvent to a class instead of a struct --- src/inputs.d | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/inputs.d b/src/inputs.d index df7f618..2bce2cf 100644 --- a/src/inputs.d +++ b/src/inputs.d @@ -10,11 +10,11 @@ enum typedef bool[INPUT_COUNT] Inputs; -struct InputEvent +class InputEvent { uint tick; Inputs inputs; - InputEvent *next; + InputEvent next; }; class InputEventList @@ -22,10 +22,10 @@ class InputEventList public: void add_event(uint tick, int event, bool active) { - InputEvent *ie = get_event_for_tick(tick); + InputEvent ie = get_event_for_tick(tick); ie.inputs[event] = active; } - InputEvent *get_event_for_tick(uint tick) + InputEvent get_event_for_tick(uint tick) { if (m_last_event is null) { @@ -41,7 +41,7 @@ public: } return m_last_event; } - InputEvent *get_first_event() { return m_events; } + InputEvent get_first_event() { return m_events; } void remove_older_than(uint tick) { while ((m_events !is null) && (m_events.tick <= tick)) @@ -55,6 +55,6 @@ public: } protected: - InputEvent *m_events; - InputEvent *m_last_event; + InputEvent m_events; + InputEvent m_last_event; };