From 694e07d193e7c5758a7d672b45668651b034003d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 May 2015 00:19:18 +0300 Subject: Convert InputAction enum into strong typed enum. --- src/input/keyinput.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/input/keyinput.h') diff --git a/src/input/keyinput.h b/src/input/keyinput.h index 8555d8bbb..229b4d212 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -66,6 +66,8 @@ #include "enums/events/keyeventtype.h" +#include "enums/input/inputaction.h" + #include "input/key.h" #include "localconsts.h" @@ -79,7 +81,7 @@ class KeyInput final #ifdef USE_SDL2 mText(), #endif - mActionId(-2) + mActionId(InputAction::UNDEFINED_VALUE) { } ~KeyInput() @@ -105,12 +107,12 @@ class KeyInput final return mKey; } - void setActionId(const int n) + void setActionId(const InputActionT n) { mActionId = n; } - int getActionId() const A_WARN_UNUSED + InputActionT getActionId() const A_WARN_UNUSED { return mActionId; } @@ -142,7 +144,7 @@ class KeyInput final std::string mText; #endif - int mActionId; + InputActionT mActionId; }; #endif // INPUT_KEYINPUT_H -- cgit v1.2.3-60-g2f50