28#include "guillaume/ecs/system_filler.hpp"
30#include "guillaume/event/event_bus.hpp"
31#include "guillaume/event/event_manager.hpp"
33#include "guillaume/components/bound.hpp"
34#include "guillaume/components/overlay.hpp"
35#include "guillaume/components/transform.hpp"
37#include <utility/engine.hpp>
38#include <utility/event/keyboard_event.hpp>
39#include <utility/math/vector.hpp>
84 utility::Engine &_engine;
86 std::vector<ecs::Entity::Identifier>
88 std::chrono::steady_clock::time_point
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.
void handleOutsideClick(const utility::math::Vector2F &point)
Close the top overlay if a click landed outside it and its component says it dismisses on outside cli...
std::size_t getDepth(void) const
The number of open overlays.
void show(const ecs::Entity::Identifier &entityIdentifier)
Open an overlay at once: push it on top of the stack, make its component visible and turn viewport in...
bool isOpen(const ecs::Entity::Identifier &entityIdentifier) const
Whether an overlay is open, that is, in the stack.
void advance(float deltaTime)
Count down the top overlay and close it when its time is up.
void handleEscape(void)
Close the top overlay if its component says it dismisses on Escape. Called by prepare() on an Escape ...
void dismiss(void)
Close the top overlay.
void update(const ecs::Entity::Identifier &entityIdentifier) override
Make the stack agree with the visibility of one overlay.
Overlay(event::EventBus &eventBus, utility::Engine &engine)
Create the system, in the Event phase, and subscribe it to keyboard events (for Escape).
~Overlay(void) override=default
Default destructor.
void prepare(void) override
Once per frame: take the next pending keyboard event, count down the top overlay, and handle Escape.
ecs::Entity::Identifier getTop(void) const
The overlay opened last, the one Escape and the countdown apply to.
Rules. Every class here runs each frame on the entities that have the components it declares.