MochiEngine
Loading...
Searching...
No Matches
Mochi::Input::VirtualActionManager Class Reference

An implementation of IActionManager that receives mock action states and allows to poll them when needed. This is useful for testing and can be a base for emulating player actions on replays or similar features. More...

#include <VirtualActionManager.h>

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

Public Member Functions

virtual bool LoadActions (std::vector< char > buffer) override
virtual bool LoadActionsFromFile (const std::string &path) override
virtual bool HasAction (const std::string &) const override
virtual void Update (const float &dt) override
virtual bool Performed (const std::string &actionName) const override
virtual float Value (const std::string &actionName) const override
virtual Vector2f CompoundValue (const std::string &action1, const std::string &action2) const override
void SetActionState (const std::string &action, const float &state)
 Sets an action on the action map to be retrieved later. This action is not changed unless SetActionState is called again with a different value.

Detailed Description

An implementation of IActionManager that receives mock action states and allows to poll them when needed. This is useful for testing and can be a base for emulating player actions on replays or similar features.

Member Function Documentation

◆ CompoundValue()

Vector2f Mochi::Input::VirtualActionManager::CompoundValue ( const std::string & action1,
const std::string & action2 ) const
overridevirtual

◆ HasAction()

bool Mochi::Input::VirtualActionManager::HasAction ( const std::string & ) const
overridevirtual

◆ LoadActions()

bool Mochi::Input::VirtualActionManager::LoadActions ( std::vector< char > buffer)
overridevirtual

◆ LoadActionsFromFile()

bool Mochi::Input::VirtualActionManager::LoadActionsFromFile ( const std::string & path)
overridevirtual

◆ Performed()

bool Mochi::Input::VirtualActionManager::Performed ( const std::string & actionName) const
overridevirtual

◆ SetActionState()

void Mochi::Input::VirtualActionManager::SetActionState ( const std::string & action,
const float & state )

Sets an action on the action map to be retrieved later. This action is not changed unless SetActionState is called again with a different value.

Parameters
actionThe name of the action to change.
stateThe value of the action. Note that for checking if an action has been performed the value has to be different from 0.

◆ Update()

void Mochi::Input::VirtualActionManager::Update ( const float & dt)
overridevirtual

◆ Value()

float Mochi::Input::VirtualActionManager::Value ( const std::string & actionName) const
overridevirtual

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