From 1435da0c878b705035fda0dfbdb31013645ce2f9 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 17 Jul 2024 01:07:22 +0200 Subject: app/ui: implement basic turn tracking --- domain/include/turns/domain/turn_order.hpp | 47 +++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'domain/include/turns') diff --git a/domain/include/turns/domain/turn_order.hpp b/domain/include/turns/domain/turn_order.hpp index d3f74eb..59438d6 100644 --- a/domain/include/turns/domain/turn_order.hpp +++ b/domain/include/turns/domain/turn_order.hpp @@ -14,31 +14,56 @@ namespace turns::domain struct turn_order : Glib::Object { + using active_participant_type = unsigned int; + using empty_type = bool; + using has_next_type = bool; + using has_previous_type = bool; + using running_type = bool; + using round_type = unsigned int; + auto static create() -> Glib::RefPtr; turn_order(); - auto add(Glib::ustring const & name, float priority, disposition disposition) -> void; + /** Modifiers */ + auto add(Glib::ustring const & name, float priority, disposition disposition) -> void; auto clear() -> void; - - auto empty() const noexcept -> bool; - - auto get(unsigned int index) -> Glib::RefPtr; - + auto next() -> void; + auto previous() -> void; auto remove(unsigned int index) -> void; - - auto size() -> unsigned int; - + auto reset() -> void; auto start() -> void; + auto stop() -> void; + + /** Querries */ + auto active_participant() const noexcept -> active_participant_type; + auto empty() const noexcept -> empty_type; + auto get(unsigned int index) const noexcept -> Glib::RefPtr; auto list_model() -> Glib::RefPtr; + auto round() const noexcept -> round_type; + auto running() const noexcept -> running_type; + auto size() const noexcept -> unsigned int; - auto property_empty() const -> Glib::PropertyProxy_ReadOnly; + /** Properties */ + + auto property_active_participant() const -> Glib::PropertyProxy_ReadOnly; + auto property_empty() const -> Glib::PropertyProxy_ReadOnly; + auto property_has_next() const -> Glib::PropertyProxy_ReadOnly; + auto property_has_previous() const -> Glib::PropertyProxy_ReadOnly; + auto property_running() const -> Glib::PropertyProxy_ReadOnly; + auto property_round() const -> Glib::PropertyProxy_ReadOnly; private: Glib::RefPtr> m_model; - Glib::Property m_empty; + + Glib::Property m_active_participant; + Glib::Property m_empty; + Glib::Property m_has_next; + Glib::Property m_has_previous; + Glib::Property m_running; + Glib::Property m_round; }; } // namespace turns::domain -- cgit v1.2.3