diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-05-23 12:26:50 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-05-23 12:26:50 +0200 |
| commit | d1d171775f768be1dcdee194be5134f334c63347 (patch) | |
| tree | 46e3ddc8d84c68d86293462f8d0c7eb8ffa85473 /lib/src/turnsmm | |
| parent | 260df0a1158385736b2da24a2e4a14e365d1ec92 (diff) | |
| download | turns-d1d171775f768be1dcdee194be5134f334c63347.tar.xz turns-d1d171775f768be1dcdee194be5134f334c63347.zip | |
lib: add empty property to TurnOrder
Diffstat (limited to 'lib/src/turnsmm')
| -rw-r--r-- | lib/src/turnsmm/turn-order.cpp | 20 | ||||
| -rw-r--r-- | lib/src/turnsmm/turn-order.hpp | 2 |
2 files changed, 17 insertions, 5 deletions
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<bool> - { - return {this, "running"}; - } - auto TurnOrder::get_sort_mode() const noexcept -> SortMode { return static_cast<SortMode>(turns_turn_order_get_sort_mode(unwrap(this))); @@ -129,6 +129,16 @@ namespace Turns turns_turn_order_set_sort_mode(unwrap(this), static_cast<TurnsTurnOrderSortMode>(value)); } + auto TurnOrder::property_empty() const noexcept -> Glib::PropertyProxy_ReadOnly<bool> + { + return {this, "empty"}; + } + + auto TurnOrder::property_running() const noexcept -> Glib::PropertyProxy_ReadOnly<bool> + { + return {this, "running"}; + } + auto TurnOrder::property_sort_mode() noexcept -> Glib::PropertyProxy<SortMode> { 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<bool>; [[nodiscard]] auto property_running() const noexcept -> Glib::PropertyProxy_ReadOnly<bool>; [[nodiscard]] auto property_sort_mode() noexcept -> Glib::PropertyProxy<SortMode>; [[nodiscard]] auto property_sort_mode() const noexcept -> Glib::PropertyProxy_ReadOnly<SortMode>; |
