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; };