diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-07-15 16:00:29 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-07-15 16:00:29 +0200 |
| commit | a23cda29f0acef40d883c37209389c956c14e83b (patch) | |
| tree | 8d9cb59da154da5cbe75cedbaf6b52ebc8d2eb54 /domain/src | |
| parent | bcea0775a7a07738b3eec1b00cef618de84f3e41 (diff) | |
| download | turns-a23cda29f0acef40d883c37209389c956c14e83b.tar.xz turns-a23cda29f0acef40d883c37209389c956c14e83b.zip | |
turns: perform widespread code cleanup actions
Diffstat (limited to 'domain/src')
| -rw-r--r-- | domain/src/participant.cpp | 24 | ||||
| -rw-r--r-- | domain/src/turn_order.cpp | 14 |
2 files changed, 33 insertions, 5 deletions
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 <utility> #include <typeinfo> +#include <utility> + +#include <glibmm/refptr.h> 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<Glib::ustring> { 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 <compare> + +#include <glibmm/refptr.h> + 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<turn_order> { |
