summaryrefslogtreecommitdiff
path: root/domain
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-14 21:30:56 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-14 21:33:04 +0200
commit05da3897f944f5775d25de2136ea985d4b0078eb (patch)
treefd817901681a745f75234979168f391310141797 /domain
parentd462e0e4d25d595175160c407e02a84155441983 (diff)
downloadturns-05da3897f944f5775d25de2136ea985d4b0078eb.tar.xz
turns-05da3897f944f5775d25de2136ea985d4b0078eb.zip
app/ui: show status view when turn order is empty
Diffstat (limited to 'domain')
-rw-r--r--domain/include/turns/domain/turn_order.hpp1
-rw-r--r--domain/src/turn_order.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/domain/include/turns/domain/turn_order.hpp b/domain/include/turns/domain/turn_order.hpp
index a82e331..de7ac8a 100644
--- a/domain/include/turns/domain/turn_order.hpp
+++ b/domain/include/turns/domain/turn_order.hpp
@@ -18,6 +18,7 @@ namespace turns::domain
auto static create() -> Glib::RefPtr<turn_order>;
auto append(Glib::ustring const & name, float order_value) -> void;
+ auto remove(Glib::RefPtr<participant> item) -> void;
auto sort() -> void;
};
diff --git a/domain/src/turn_order.cpp b/domain/src/turn_order.cpp
index 81b7fe7..677e993 100644
--- a/domain/src/turn_order.cpp
+++ b/domain/src/turn_order.cpp
@@ -31,6 +31,14 @@ namespace turns::domain
insert_sorted(participant, comparator);
}
+ auto turn_order::remove(Glib::RefPtr<participant> item) -> void
+ {
+ if (auto [was_found, index] = find(item); was_found)
+ {
+ super::remove(index);
+ }
+ }
+
auto turn_order::sort() -> void
{
super::sort(comparator);