12 , controllable(controllable)
17 systems.
engine().inputSystem().getActor().addListener(*
this);
24 systems.
engine().inputSystem().getActor().removeListener(*
this);
28 bl::input::DispatchType,
bool fromEvent) {
29 if (controllable.
isLocked())
return true;
35 bl::event::Dispatcher::dispatch<event::StateChange>(
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.
Adding this component to an entity allows it to be controlled.
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.
PlayerControlled(system::Systems &systems, Controllable &controllable)
Construct a new Player Controlled component and immediately start taking player input....
void start()
Activate this listener and receive player input. Does not have effect if already activated but anothe...
virtual bool observe(const bl::input::Actor &, unsigned int ctrl, bl::input::DispatchType, bool) override
Forwards the player input to the underlying entity.
void stop()
Stops listening to player input.
@ GamePaused
The game should pause.
Owns all primary systems and a reference to the engine.
const bl::engine::Engine & engine() const
Const accessor for the Engine.