summaryrefslogtreecommitdiff
path: root/domain
diff options
context:
space:
mode:
Diffstat (limited to 'domain')
-rw-r--r--domain/include/turns/domain/participant.hpp5
-rw-r--r--domain/include/turns/domain/turn_order.hpp4
-rw-r--r--domain/src/participant.cpp24
-rw-r--r--domain/src/turn_order.cpp14
-rw-r--r--domain/tests/participant.cpp4
5 files changed, 42 insertions, 9 deletions
diff --git a/domain/include/turns/domain/participant.hpp b/domain/include/turns/domain/participant.hpp
index f417ec7..a097abd 100644
--- a/domain/include/turns/domain/participant.hpp
+++ b/domain/include/turns/domain/participant.hpp
@@ -22,8 +22,13 @@ namespace turns::domain
auto property_name() -> Glib::PropertyProxy<Glib::ustring>;
auto property_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>;
+ auto get_name() const -> Glib::ustring;
+ auto set_name(Glib::ustring value) -> void;
+
auto property_priority() -> Glib::PropertyProxy<float>;
auto property_priority() const -> Glib::PropertyProxy_ReadOnly<float>;
+ auto get_priority() const noexcept -> float;
+ auto set_priority(float value) -> void;
private:
Glib::Property<Glib::ustring> m_name;
diff --git a/domain/include/turns/domain/turn_order.hpp b/domain/include/turns/domain/turn_order.hpp
index f7eb773..cb51af6 100644
--- a/domain/include/turns/domain/turn_order.hpp
+++ b/domain/include/turns/domain/turn_order.hpp
@@ -4,8 +4,8 @@
#include "turns/domain/participant.hpp"
#include <giomm/liststore.h>
-#include <glibmm/ustring.h>
#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
namespace turns::domain
{
@@ -15,8 +15,8 @@ namespace turns::domain
using super = Gio::ListStore<participant>;
using super::super;
- using super::remove;
using super::append;
+ using super::remove;
auto static create() -> Glib::RefPtr<turn_order>;
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>
{
diff --git a/domain/tests/participant.cpp b/domain/tests/participant.cpp
index f6abef9..e9e7c46 100644
--- a/domain/tests/participant.cpp
+++ b/domain/tests/participant.cpp
@@ -2,10 +2,10 @@
#include <catch2/catch_test_macros.hpp>
-#include <glibmm/init.h>
-
#include <compare>
+#include <glibmm/init.h>
+
namespace turns::domain::tests
{