25#include "guillaume/ecs/system_filler.hpp"
27#include "guillaume/components/card.hpp"
std::function< void(void)> Handler
Callback run when the card is pressed.
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...
void update(const ecs::Entity::Identifier &entityIdentifier) override
Run apply() on one card; called by the frame loop.
static void press(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Activate the card as a click or a key press would.
Card(void)
Create the system in the Layout phase.
static void install(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Prepare the press-elevation motion of a card.
static void setDisabled(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool disabled)
Enable or disable the card and restyle it.
~Card(void) override=default
Default destructor.
static float contentWidth(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Get the width a section of the card can use, in dp.
static void interactionChanged(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
React to a change of the hover or press state of the card.
static bool isDisabled(const ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Whether the card ignores input.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Style one card and arrange its sections.
static void setOnPress(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, components::Card::Handler handler)
Set the press handler and make the card pressable.
Rules. Every class here runs each frame on the entities that have the components it declares.