A class representing the connection between an Action generated by the InputManager, and a BaseSimObjectAspect method that is interested in handling the action.
More...
#include <sim_system.hpp>
|
bool | call (const ActionData &actionData, const ActionDefinition &actionDefinition) |
| Calls the handler this binding holds a reference to with some newly received action data generated by the input system.
|
|
| FixedActionBinding (const std::string &context, const std::string &name, std::function< bool(const ActionData &, const ActionDefinition &)> handler) |
| Constructs a new binding object with the given action name and context, and a reference to the function interested in handling that action.
|
|
|
std::string | mContext |
| The name of the context owning the action.
|
|
std::string | mName |
| The name of the action itself.
|
|
std::function< bool(const ActionData &, const ActionDefinition &)> | mHandler |
| A reference to the handler interested in receiving the action.
|
|
|
class | BaseSimObjectAspect |
|
A class representing the connection between an Action generated by the InputManager, and a BaseSimObjectAspect method that is interested in handling the action.
- See also
- BaseSimObjectAspect::declareFixedActionBinding()
-
ActionDefinition
-
ActionData
◆ FixedActionBinding()
ToyMaker::FixedActionBinding::FixedActionBinding |
( |
const std::string & | context, |
|
|
const std::string & | name, |
|
|
std::function< bool(const ActionData &, const ActionDefinition &)> | handler ) |
|
inlineprivate |
Constructs a new binding object with the given action name and context, and a reference to the function interested in handling that action.
- Parameters
-
context | The context name of the action. |
name | The name of the action itself. |
handler | The handler interested in receiving the action. |
◆ call()
Calls the handler this binding holds a reference to with some newly received action data generated by the input system.
- Parameters
-
actionData | The data of the generated action event. |
actionDefinition | The definition of the action. |
- Return values
-
true | The action was handled by this aspect; |
false | The action was not handled by this aspect. |
◆ mHandler
A reference to the handler interested in receiving the action.
Such a handler must return a boolean value. true
indicates that the handler was able to do something with the action, while false
indicates that nothing was done with the action.
The documentation for this class was generated from the following file: