Chicane

Controller

Header
Chicane/Game/Controller/Instance.hpp
Namespace
Chicane::Controller

Traduz os inputs do usuário para o Pawn.

Construtores

ModificadorNomeDescrição
Controller()

Destruidores

ModificadorNomeDescrição
virtual~Controller()

Funções

AcessoModificadorTipoNomeDescrição
publicconst T*getPawn<T>()
publicvoidwatchAttachment(std::function<void (Pawn*)> inNext, std::function<void (const std::string&)> inError, std::function<void ()> inComplete)
publicboolisAttached()
publicvoiddeattach()
publicvoidattachTo(Pawn* inPawn)
publicvoidbindMouseMotionEvent(std::function<void(const SDL_MouseMotionEvent&)> inEvent)
publicvoidbindMouseButtonEvent(std::uint8_t inButtonCode, std::function<void(bool)> inEvent)
publicvoidbindKeyboardButtonEvent(SDL_Scancode inButtonCode, std::function<void(bool)> inEvent)
publicvoidbindControllerMotionEvent(std::function<void(const SDL_GamepadAxisEvent&)> inEvent)
publicvoidbindControllerButtonEvent(std::uint8_t inButtonCode, std::function<void(bool)> inEvent)
publicvoidonEvent(const SDL_Event& inEvent)
privatevoidonMouseButtonEvent(const SDL_MouseButtonEvent& inEvent)
privatevoidonKeyboardButtonEvent(const SDL_KeyboardEvent& inEvent)
privatevoidonControllerButtonEvent(const SDL_GamepadButtonEvent& inEvent)
privatevoidclearEvents()

Propriedades

AcessoModificadorTipoNomeDescrição
privatePawn*m_pawn
privatestd::unique_ptr<Observable<Pawn*>>m_pawnObservable
privatestd::function<void(const SDL_MouseMotionEvent&)m_mouseMotionEvent
privatestd::unordered_map<std::uint8_t, std::function<void(bool)>>m_mouseButtonEvents
privatestd::unordered_map<SDL_Scancode, std::function<void(bool)>>m_keyboardButtonEvents
privatestd::function<void(const SDL_GamepadAxisEvent&)>m_controllerMotionEvent
privatestd::unordered_map<std::uint8_t, std::function<void(bool)>>m_controllerButtonEvents