summaryrefslogtreecommitdiff
path: root/domain/include
diff options
context:
space:
mode:
Diffstat (limited to 'domain/include')
-rw-r--r--domain/include/turns/domain/turn_order.hpp47
1 files changed, 36 insertions, 11 deletions
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>;
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<participant>;
-
+ 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<participant>;
auto list_model() -> Glib::RefPtr<Gio::ListModel>;
+ 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<bool>;
+ /** Properties */
+
+ auto property_active_participant() const -> Glib::PropertyProxy_ReadOnly<active_participant_type>;
+ auto property_empty() const -> Glib::PropertyProxy_ReadOnly<empty_type>;
+ auto property_has_next() const -> Glib::PropertyProxy_ReadOnly<has_next_type>;
+ auto property_has_previous() const -> Glib::PropertyProxy_ReadOnly<has_previous_type>;
+ auto property_running() const -> Glib::PropertyProxy_ReadOnly<running_type>;
+ auto property_round() const -> Glib::PropertyProxy_ReadOnly<round_type>;
private:
Glib::RefPtr<Gio::ListStore<participant>> m_model;
- Glib::Property<bool> m_empty;
+
+ Glib::Property<active_participant_type> m_active_participant;
+ Glib::Property<empty_type> m_empty;
+ Glib::Property<has_next_type> m_has_next;
+ Glib::Property<has_previous_type> m_has_previous;
+ Glib::Property<running_type> m_running;
+ Glib::Property<round_type> m_round;
};
} // namespace turns::domain