From a23cda29f0acef40d883c37209389c956c14e83b Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 15 Jul 2024 16:00:29 +0200 Subject: turns: perform widespread code cleanup actions --- domain/src/participant.cpp | 24 +++++++++++++++++++++++- domain/src/turn_order.cpp | 14 ++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) (limited to 'domain/src') diff --git a/domain/src/participant.cpp b/domain/src/participant.cpp index 5c31e2a..7ff9ce1 100644 --- a/domain/src/participant.cpp +++ b/domain/src/participant.cpp @@ -1,7 +1,9 @@ #include "turns/domain/participant.hpp" -#include #include +#include + +#include namespace turns::domain { @@ -23,6 +25,26 @@ namespace turns::domain return m_priority <=> other.m_priority; } + auto participant::get_name() const -> Glib::ustring + { + return m_name; + } + + auto participant::set_name(Glib::ustring value) -> void + { + m_name = value; + } + + auto participant::get_priority() const noexcept -> float + { + return m_priority; + } + + auto participant::set_priority(float value) -> void + { + m_priority = value; + } + auto participant::property_name() -> Glib::PropertyProxy { return m_name.get_proxy(); diff --git a/domain/src/turn_order.cpp b/domain/src/turn_order.cpp index 4c5c587..454e27a 100644 --- a/domain/src/turn_order.cpp +++ b/domain/src/turn_order.cpp @@ -1,23 +1,29 @@ #include "turns/domain/turn_order.hpp" +#include "turns/domain/participant.hpp" + +#include + +#include + namespace turns::domain { namespace { - auto constexpr comparator = [](auto lhs, auto rhs){ + auto constexpr comparator = [](auto lhs, auto rhs) { auto result = *lhs <=> *rhs; - if(result == std::partial_ordering::equivalent || result == std::partial_ordering::unordered) + if (result == std::partial_ordering::equivalent || result == std::partial_ordering::unordered) { return 0; } - else if(result == std::partial_ordering::less) + else if (result == std::partial_ordering::less) { return 1; } return -1; }; - } + } // namespace auto turn_order::create() -> Glib::RefPtr { -- cgit v1.2.3