diff --git a/source/core/input/input.cpp b/source/core/input/input.cpp index cd5e28f..22e3e16 100644 --- a/source/core/input/input.cpp +++ b/source/core/input/input.cpp @@ -88,7 +88,7 @@ Input::~Input() { // Actualiza el estado del objeto void Input::update() { - if (disabled_until_ == KEY_PRESSED && !checkAnyInput()) { + if (disabled_until_ == Disable::KEY_PRESSED && !checkAnyInput()) { enable(); } } @@ -378,7 +378,7 @@ void Input::setVerbose(bool value) { } // Deshabilita las entradas durante un periodo de tiempo -void Input::disableUntil(InputDisable value) { +void Input::disableUntil(Disable value) { disabled_until_ = value; enabled_ = false; } @@ -386,5 +386,5 @@ void Input::disableUntil(InputDisable value) { // Hablita las entradas void Input::enable() { enabled_ = true; - disabled_until_ = NOT_DISABLED; + disabled_until_ = Disable::NOT_DISABLED; } diff --git a/source/core/input/input.h b/source/core/input/input.h index 6a7d5d5..9989bb8 100644 --- a/source/core/input/input.h +++ b/source/core/input/input.h @@ -6,12 +6,6 @@ #include // for string, basic_string #include // for vector -enum InputDisable : std::uint8_t { - NOT_DISABLED, - FOREVER, - KEY_PRESSED -}; - class Input { public: enum class Repeat : std::uint8_t { @@ -25,6 +19,12 @@ class Input { ANY }; + enum class Disable : std::uint8_t { + NOT_DISABLED, + FOREVER, + KEY_PRESSED + }; + enum class Action : std::uint8_t { // Inputs obligatorios INVALID, @@ -83,7 +83,7 @@ class Input { auto getControllerName(int index) -> std::string; // Obten el nombre de un mando de juego void setVerbose(bool value); // Establece si ha de mostrar mensajes - void disableUntil(InputDisable value); // Deshabilita las entradas durante un periodo de tiempo + void disableUntil(Disable value); // Deshabilita las entradas durante un periodo de tiempo void enable(); // Hablita las entradas private: @@ -108,7 +108,7 @@ class Input { int num_gamepads_{0}; // Numero de mandos conectados std::string db_path_; // Ruta al archivo gamecontrollerdb.txt bool verbose_{true}; // Indica si ha de mostrar mensajes - InputDisable disabled_until_{NOT_DISABLED}; // Tiempo que esta deshabilitado + Disable disabled_until_{Disable::NOT_DISABLED}; // Tiempo que esta deshabilitado bool enabled_{true}; // Indica si está habilitado static Input *instance; // Instancia única