5#ifndef MALENA_SELECTABLE_H
6#define MALENA_SELECTABLE_H
81 void onSelected(std::function<
void(
const std::optional<sf::Event>&)> callback);
100 void onDeselected(std::function<
void(
const std::optional<sf::Event>&)> callback);
Base class for all event-receiving traits.
Trait that adds selection and deselection callbacks to any Core object.
void deselect()
Fire the onDeselected callbacks on this component.
void onDeselected(std::function< void()> callback)
Register a no-argument callback invoked when this component is deselected.
void onSelected(std::function< void()> callback)
Register a no-argument callback invoked when this component is selected.
void select()
Fire the onSelected callbacks on this component.
void onSelected(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked when this component is selected, receiving the raw SFML event (always std...
void onDeselected(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked when this component is deselected, receiving the raw SFML event (always s...