diff options
Diffstat (limited to 'domain/include')
| -rw-r--r-- | domain/include/turns/domain/turn_order.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/domain/include/turns/domain/turn_order.hpp b/domain/include/turns/domain/turn_order.hpp index 59438d6..3b42562 100644 --- a/domain/include/turns/domain/turn_order.hpp +++ b/domain/include/turns/domain/turn_order.hpp @@ -4,6 +4,8 @@ #include "turns/domain/disposition.hpp" #include "turns/domain/participant.hpp" +#include <limits> + #include <giomm/liststore.h> #include <glibmm/property.h> #include <glibmm/refptr.h> @@ -21,6 +23,8 @@ namespace turns::domain using running_type = bool; using round_type = unsigned int; + auto static constexpr invalid_participant_index = std::numeric_limits<active_participant_type>::max(); + auto static create() -> Glib::RefPtr<turn_order>; turn_order(); @@ -38,12 +42,43 @@ namespace turns::domain /** Querries */ + /** + * Get the index of the currently active participant of this turn order, if any. + * + * @returns an unsigned integer in the range [0, size()) if there is an active participant, or turn_order::invalid_participant_index otherwise. + */ auto active_participant() const noexcept -> active_participant_type; + + /** + * Check if this turn order is empty. + */ auto empty() const noexcept -> empty_type; + + /** + * Get the actor at the specified position in this turn order. + * + * @return a valid pointer to a participant object if the index was valid, nullptr otherwise. + */ auto get(unsigned int index) const noexcept -> Glib::RefPtr<participant>; + + /** + * Get the underlying list model, to be used with list views. + */ auto list_model() -> Glib::RefPtr<Gio::ListModel>; + + /** + * Get the current round. + */ auto round() const noexcept -> round_type; + + /** + * Check if this turn order is currently running. + */ auto running() const noexcept -> running_type; + + /** + * Get the size of this turn order + */ auto size() const noexcept -> unsigned int; /** Properties */ |
