27#include <utility/engine.hpp>
29#include "guillaume/ecs/system_filler.hpp"
30#include "guillaume/event/event_bus.hpp"
31#include "guillaume/event/event_manager.hpp"
33#include <utility/event/keyboard_event.hpp>
37#include "guillaume/components/focus.hpp"
38#include "guillaume/components/transform.hpp"
39#include "guillaume/components/bound.hpp"
40#include "guillaume/components/mouse_button_interaction.hpp"
41#include "guillaume/components/hand_button_interaction.hpp"
42#include "guillaume/components/hand_pinch_interaction.hpp"
43#include "guillaume/components/hand_poke_interaction.hpp"
86 components::Focus, components::Transform, components::Bound,
87 components::MouseButtonInteraction,
88 components::HandButtonInteraction, components::HandPinchInteraction,
89 components::HandPokeInteraction>,
93 utility::Engine &_engine;
95 std::optional<ecs::Entity::Identifier>
97 std::optional<ecs::Entity::Identifier>
100 std::vector<std::pair<ecs::Entity::Identifier, int>>
185 void traverse(
const std::vector<std::pair<ecs::Entity::Identifier, int>>
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...
Hands each engine event to the listeners subscribed to its type.
Base class that gives a system the input events of one type, one event per frame.
Focus(event::EventBus &eventBus, utility::Engine &engine)
Create the system, in the Event phase, and subscribe it to keyboard events (for Tab traversal).
std::optional< ecs::Entity::Identifier > getFocusedEntity(void) const
The entity holding the focus.
void clearFocus(void)
Take the focus away from the focused entity.
void setFocus(const ecs::Entity::Identifier &entityIdentifier)
Give the focus to an entity.
virtual void update(const ecs::Entity::Identifier &entityIdentifier) override
Focus one entity if it is being pressed, and record it as a Tab candidate if it is focusable.
void traverse(const std::vector< std::pair< ecs::Entity::Identifier, int > > &candidates, bool backward)
Move the focus to the next or previous candidate.
void cleanup(void) override
Run Tab traversal once every entity has been visited.
std::optional< ecs::Entity::Identifier > getLastFocusedEntity(void) const
The entity that held the focus before the current one, or before the focus was cleared.
void prepare(void) override
Empty the list of focusable entities and take the next pending keyboard event, once per frame.
Rules. Every class here runs each frame on the entities that have the components it declares.