From d1d171775f768be1dcdee194be5134f334c63347 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 23 May 2025 12:26:50 +0200 Subject: lib: add empty property to TurnOrder --- lib/src/turnsmm/turn-order.cpp | 20 +++++++++++++++----- lib/src/turnsmm/turn-order.hpp | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'lib/src/turnsmm') diff --git a/lib/src/turnsmm/turn-order.cpp b/lib/src/turnsmm/turn-order.cpp index 3767817..5f38ded 100644 --- a/lib/src/turnsmm/turn-order.cpp +++ b/lib/src/turnsmm/turn-order.cpp @@ -104,6 +104,11 @@ namespace Turns return turns_turn_order_remove_at(unwrap(this), position); } + auto TurnOrder::get_empty() const noexcept -> bool + { + return turns_turn_order_get_empty(Glib::unwrap(this)); + } + auto TurnOrder::get_participant_count() const noexcept -> std::size_t { return turns_turn_order_get_participant_count(unwrap(this)); @@ -114,11 +119,6 @@ namespace Turns return turns_turn_order_get_running(unwrap(this)); } - auto TurnOrder::property_running() const noexcept -> Glib::PropertyProxy_ReadOnly - { - return {this, "running"}; - } - auto TurnOrder::get_sort_mode() const noexcept -> SortMode { return static_cast(turns_turn_order_get_sort_mode(unwrap(this))); @@ -129,6 +129,16 @@ namespace Turns turns_turn_order_set_sort_mode(unwrap(this), static_cast(value)); } + auto TurnOrder::property_empty() const noexcept -> Glib::PropertyProxy_ReadOnly + { + return {this, "empty"}; + } + + auto TurnOrder::property_running() const noexcept -> Glib::PropertyProxy_ReadOnly + { + return {this, "running"}; + } + auto TurnOrder::property_sort_mode() noexcept -> Glib::PropertyProxy { return {this, "sort_mode"}; diff --git a/lib/src/turnsmm/turn-order.hpp b/lib/src/turnsmm/turn-order.hpp index fe8c756..3fb55e4 100644 --- a/lib/src/turnsmm/turn-order.hpp +++ b/lib/src/turnsmm/turn-order.hpp @@ -53,12 +53,14 @@ namespace Turns auto clear() noexcept -> void; auto remove_at(guint position) noexcept -> void; + [[nodiscard]] auto get_empty() const noexcept -> bool; [[nodiscard]] auto get_participant_count() const noexcept -> std::size_t; [[nodiscard]] auto get_running() const noexcept -> bool; [[nodiscard]] auto get_sort_mode() const noexcept -> SortMode; auto set_sort_mode(SortMode value) noexcept -> void; + [[nodiscard]] auto property_empty() const noexcept -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_running() const noexcept -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_sort_mode() noexcept -> Glib::PropertyProxy; [[nodiscard]] auto property_sort_mode() const noexcept -> Glib::PropertyProxy_ReadOnly; -- cgit v1.2.3