diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-07-14 16:39:58 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-07-14 16:39:58 +0200 |
| commit | 37732d5ccae97d80a9083ae295af018f154edb5a (patch) | |
| tree | 45977187c68fe016fab835788486854211f7cf40 /domain/include | |
| parent | 3e6cc7e8e068447a2a2064754df56e18a1cf1c58 (diff) | |
| download | turns-37732d5ccae97d80a9083ae295af018f154edb5a.tar.xz turns-37732d5ccae97d80a9083ae295af018f154edb5a.zip | |
domain: add basic turn order type
Diffstat (limited to 'domain/include')
| -rw-r--r-- | domain/include/turns/domain/participant.hpp | 4 | ||||
| -rw-r--r-- | domain/include/turns/domain/turn_order.hpp | 26 |
2 files changed, 28 insertions, 2 deletions
diff --git a/domain/include/turns/domain/participant.hpp b/domain/include/turns/domain/participant.hpp index 7c047ea..934e0bb 100644 --- a/domain/include/turns/domain/participant.hpp +++ b/domain/include/turns/domain/participant.hpp @@ -22,8 +22,8 @@ namespace turns::domain auto property_name() -> Glib::PropertyProxy<Glib::ustring>; auto property_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_over_value() -> Glib::PropertyProxy<float>; - auto property_over_value() const -> Glib::PropertyProxy_ReadOnly<float>; + auto property_order_value() -> Glib::PropertyProxy<float>; + auto property_order_value() const -> Glib::PropertyProxy_ReadOnly<float>; 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 new file mode 100644 index 0000000..8c9afa7 --- /dev/null +++ b/domain/include/turns/domain/turn_order.hpp @@ -0,0 +1,26 @@ +#ifndef TURNS_DOMAIN_TURN_ORDER_HPP +#define TURNS_DOMAIN_TURN_ORDER_HPP + +#include "turns/domain/participant.hpp" + +#include <giomm/liststore.h> +#include <glibmm/ustring.h> +#include <glibmm/refptr.h> + +namespace turns::domain +{ + + struct turn_order : Gio::ListStore<participant> + { + using super = Gio::ListStore<participant>; + using super::super; + + auto static create() -> Glib::RefPtr<turn_order>; + + auto append(Glib::ustring const & name, float order_value) -> turn_order &; + auto sort() -> void; + }; + +} // namespace turns::domain + +#endif
\ No newline at end of file |
