3 #include <BLIB/Logging.hpp>
17 if (locked && !ignoreLock)
return false;
40 BL_LOG_WARN <<
"Unknown control: " <<
static_cast<int>(ctrl);
46 if (p) wasLocked = locked;
Core classes and functionality for both the editor and game.
std::underlying_type_t< Control::EntityControl > EntityControl
Helper typedef to avoid too much casting boilerplate.
void setLocked(bool lock, bool preserve=true)
Locks the controllable and prevents any commands from being processed. Optionally remembers the previ...
void resetLock()
Resets the lock state back to the last preserved state.
bool processControl(input::EntityControl command, bool sprint=false, bool overrideLock=false)
Processes the given command and manipulates the entity accordingly.
bool isLocked() const
Returns whether or not this component is locked.
Controllable(system::Systems &systems, bl::ecs::Entity owner)
Construct a new Controllable component.
bool interact(bl::ecs::Entity interactor)
Performs an interation on behalf of the given entity.
bool moveEntity(bl::ecs::Entity entity, bl::tmap::Direction direction, bool fast)
Moves an entity in the given direction using either its fast or slow speed.
Owns all primary systems and a reference to the engine.
Movement & movement()
Returns a reference to the movement system.
Interaction & interaction()
Returns the interaction system.