MochiEngine
Loading...
Searching...
No Matches
Mochi::Input::IActionManager Class Referenceabstract

IActionManager is an interface with the purpose of giving the ability to identify which actions are being performed by the player. Do not mistake this by an input manager that returns true or false if some key is pressed. An action manager should identify is a button or key has been pressed this frame, or released, or the relative value of an analog control like a joystick. The responsibility of those features comes with the implementation. More...

#include <IActionManager.h>

Inheritance diagram for Mochi::Input::IActionManager:
Mochi::Input::ActionManager Mochi::Input::VirtualActionManager

Public Member Functions

virtual bool LoadActions (std::vector< char > buffer)=0
virtual bool LoadActionsFromFile (const std::string &path)=0
virtual bool HasAction (const std::string &) const =0
virtual void Update (const float &dt)=0
virtual bool Performed (const std::string &actionName) const =0
virtual float Value (const std::string &actionName) const =0
virtual Vector2f CompoundValue (const std::string &action1, const std::string &action2) const =0

Detailed Description

IActionManager is an interface with the purpose of giving the ability to identify which actions are being performed by the player. Do not mistake this by an input manager that returns true or false if some key is pressed. An action manager should identify is a button or key has been pressed this frame, or released, or the relative value of an analog control like a joystick. The responsibility of those features comes with the implementation.

Actually, a single ActionManager implementation should be enough for any game, but this interface allows us to implement also VirtualActionManager, which is useful for tests. Check those two classes for more information on the implemented methods.

Member Function Documentation

◆ CompoundValue()

virtual Vector2f Mochi::Input::IActionManager::CompoundValue ( const std::string & action1,
const std::string & action2 ) const
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ HasAction()

virtual bool Mochi::Input::IActionManager::HasAction ( const std::string & ) const
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ LoadActions()

virtual bool Mochi::Input::IActionManager::LoadActions ( std::vector< char > buffer)
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ LoadActionsFromFile()

virtual bool Mochi::Input::IActionManager::LoadActionsFromFile ( const std::string & path)
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ Performed()

virtual bool Mochi::Input::IActionManager::Performed ( const std::string & actionName) const
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ Update()

virtual void Mochi::Input::IActionManager::Update ( const float & dt)
pure virtual

Implemented in Mochi::Input::ActionManager.

◆ Value()

virtual float Mochi::Input::IActionManager::Value ( const std::string & actionName) const
pure virtual

Implemented in Mochi::Input::ActionManager.


The documentation for this class was generated from the following file: