24#include "guillaume/ecs/system_filler.hpp"
26#include "guillaume/components/switch.hpp"
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
The base class to derive a system from: a System whose signature is the list of component types given...
Switch(void)
Create the system for the Layout phase, matching entities that have a components::Switch.
static void setChecked(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool checked)
Turn the switch on or off from code.
~Switch(void) override=default
Default destructor.
void update(const ecs::Entity::Identifier &entityIdentifier) override
Frame entry point: call apply on one switch.
static bool isChecked(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the switch is on.
static void install(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Make an entity behave as a switch.
static bool isDisabled(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the switch ignores input and is drawn disabled.
static void toggle(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Flip the switch as a click does.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Draw one switch from its components: thumb position, colors and accessibility.
Rules. Every class here runs each frame on the entities that have the components it declares.