From 474f1302eaf868e2b311d6561a69cae8f736a7c1 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 16 Jul 2024 17:31:57 +0200 Subject: app: move turn order management logic to turn_order --- domain/include/turns/domain/turn_order.hpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'domain/include') diff --git a/domain/include/turns/domain/turn_order.hpp b/domain/include/turns/domain/turn_order.hpp index d7f8821..8f65104 100644 --- a/domain/include/turns/domain/turn_order.hpp +++ b/domain/include/turns/domain/turn_order.hpp @@ -5,29 +5,40 @@ #include "turns/domain/participant.hpp" #include +#include #include #include namespace turns::domain { - struct turn_order : Gio::ListStore + struct turn_order : Glib::Object { - using super = Gio::ListStore; - using super::super; - - using super::remove; - auto static create() -> Glib::RefPtr; + turn_order(); + auto append(Glib::RefPtr item) -> void; auto append(Glib::ustring const & name, float priority, disposition disposition) -> void; + + auto get_participant(unsigned int index) -> Glib::RefPtr; + + auto list_model() -> Glib::RefPtr; + + auto n_participants() -> unsigned int; + auto remove(Glib::RefPtr item) -> void; + auto remove(unsigned int index) -> void; + auto remove_all() -> void; + + auto start() -> void; + + auto get_empty() const noexcept -> bool; + auto property_empty() const -> Glib::PropertyProxy_ReadOnly; private: - using super::insert; - using super::insert_sorted; - using super::sort; + Glib::RefPtr> m_model; + Glib::Property m_empty; }; } // namespace turns::domain -- cgit v1.2.3