#ifndef InputProxy_h__ #define InputProxy_h__ #include #include "../Common.h" #include "../Core/ResourceManager.h" #include "../Core/ConfigFile.h" #include "EInputCommand.h" #include "EBindOrigin.h" class InputHandler; class InputProxy { public: InputProxy(EventBroker* eventBroker); ~InputProxy(); void LoadBindings(std::string file); void Update(double dt); void Process(bool suppressNewEvents = false); template void AddHandler(); void Publish(const Events::InputCommand& e); protected: EventBroker* m_EventBroker; std::vector m_Handlers; std::map> m_CommandHandlers; // Represents every unique command (has of PlayerID & Command) and all values reported for that command this frame std::map, std::vector> m_CommandQueue; std::map m_CurrentCommandValues; std::map m_LastCommandValues; EventRelay m_EBindOrigin; bool OnBindOrigin(const Events::BindOrigin& e); }; template void InputProxy::AddHandler() { m_Handlers.push_back(new T(m_EventBroker, this)); } #endif