11#include <unordered_map>
13#include <glm/vec2.hpp>
15namespace Imago::Engine
33 friend class InputHandler;
34 friend class SystemScheduler;
36 friend class InputStateTestAccess;
39 enum class Phase { Frame, Fixed };
45 bool beganFrame =
false;
46 bool endedFrame =
false;
47 bool beganFixed =
false;
48 bool endedFixed =
false;
53 std::vector<ActionState> _actions;
54 std::unordered_map<std::string, ActionId> _ids;
55 Phase _phase = Phase::Frame;
64 ActionId add_action(
const std::string& name);
85 const ActionState* get(
ActionId action)
const;
100 ActionId resolve(
const std::string& name)
const;
105 void begin_frame_phase();
108 void end_frame_phase();
111 void begin_fixed_step();
114 void end_fixed_step();
137 bool held(
const std::string& action)
const;
141 bool began(
const std::string& action)
const;
145 bool ended(
const std::string& action)
const;
153 float strength(
const std::string& action)
const;
161 float axis(
const std::string& negative,
const std::string& positive)
const;
169 glm::vec2
direction(
const std::string& left,
const std::string& right,
const std::string& up,
const std::string& down)
const;