![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Adding this component to an entity allows it to be controlled. More...
#include <Controllable.hpp>
Public Member Functions | |
Controllable (system::Systems &systems, bl::ecs::Entity owner) | |
Construct a new Controllable component. More... | |
bool | processControl (input::EntityControl command, bool sprint=false, bool overrideLock=false) |
Processes the given command and manipulates the entity accordingly. More... | |
void | setLocked (bool lock, bool preserve=true) |
Locks the controllable and prevents any commands from being processed. Optionally remembers the previous lock state to reset back to. More... | |
void | resetLock () |
Resets the lock state back to the last preserved state. More... | |
bool | isLocked () const |
Returns whether or not this component is locked. More... | |
Adding this component to an entity allows it to be controlled.
Definition at line 22 of file Controllable.hpp.
core::component::Controllable::Controllable | ( | system::Systems & | systems, |
bl::ecs::Entity | owner | ||
) |
Construct a new Controllable component.
systems | The primary systems object |
owner | The entity that owns this component |
Definition at line 10 of file Controllable.cpp.
bool core::component::Controllable::isLocked | ( | ) | const |
Returns whether or not this component is locked.
Definition at line 52 of file Controllable.cpp.
bool core::component::Controllable::processControl | ( | input::EntityControl | command, |
bool | sprint = false , |
||
bool | overrideLock = false |
||
) |
Processes the given command and manipulates the entity accordingly.
command | The command to apply |
sprint | True to sprint, false to walk. Only has effect if processing a move control |
overrideLock | True to process the control even if locked |
Definition at line 16 of file Controllable.cpp.
void core::component::Controllable::resetLock | ( | ) |
Resets the lock state back to the last preserved state.
Definition at line 50 of file Controllable.cpp.
void core::component::Controllable::setLocked | ( | bool | lock, |
bool | preserve = true |
||
) |
Locks the controllable and prevents any commands from being processed. Optionally remembers the previous lock state to reset back to.
lock | True to lock, false to unlock |
preserve | True to remember previous lock state, false to discard |
Definition at line 45 of file Controllable.cpp.