/* * SPDX-FileCopyrightText: 2025 Felix Morgner * SPDX-License-Identifier: LGPL-2.1-only */ #ifndef TURNS_TURN_ORDER_H #define TURNS_TURN_ORDER_H #include "turns-participant.h" #include #include G_BEGIN_DECLS /** * TurnsTurnOrderSortMode: * @TURNS_TURN_ORDER_SORT_MODE_DESCENDING: Sort higher priorities before lower ones * @TURNS_TURN_ORDER_SORT_MODE_ASCENDING: Sort higher priorities after lower ones * * Orderings that can be applied to the turn order. * * See [property@Turns.TurnOrder.sort-mode] */ typedef enum { TURNS_TURN_ORDER_SORT_MODE_DESCENDING, TURNS_TURN_ORDER_SORT_MODE_ASCENDING, } TurnsTurnOrderSortMode; GType turns_turn_order_sort_mode_get_type(void) G_GNUC_CONST; #define TURNS_TYPE_TURN_ORDER_SORT_MODE (turns_turn_order_sort_mode_get_type()) #define TURNS_TYPE_TURN_ORDER turns_turn_order_get_type() G_DECLARE_FINAL_TYPE(TurnsTurnOrder, turns_turn_order, TURNS, TURN_ORDER, GObject) /** * TurnsTurnOrder: * * Manages the order of turns for a given set of `TurnsParticipant`s. */ /** * turns_turn_order_new: * * Creates a new turn order. * * Returns: (transfer full): a new `TurnsTurnOrder`. */ TurnsTurnOrder * turns_turn_order_new(void) G_GNUC_WARN_UNUSED_RESULT; /** * turns_turn_order_add: * @self: a turn order. * @participant: (transfer full): A participant to be added. * * Adds a participant to a turn-order. */ void turns_turn_order_add(TurnsTurnOrder * self, TurnsParticipant * participant); /** * turns_turn_order_get_participant_count: * @self: a turn order. * * Gets the number of participants in the turn order. */ gsize turns_turn_order_get_participant_count(TurnsTurnOrder const * self) G_GNUC_WARN_UNUSED_RESULT; /** * turns_turn_order_get_running: (get-property running): * @self: a turn order. * * Gets whether the turn order is currently running. */ gboolean turns_turn_order_get_running(TurnsTurnOrder const * self) G_GNUC_WARN_UNUSED_RESULT; /** * turns_turn_order_get_sort_mode: (get-property sort-mode): * @self: a turn order. * * Gets whether higher priority values are sorted before or after lower ones. */ TurnsTurnOrderSortMode turns_turn_order_get_sort_mode(TurnsTurnOrder const * self) G_GNUC_WARN_UNUSED_RESULT; /** * turns_turn_order_set_sort_mode: (set-property sort-mode): * @self: a turn order. * @sort_mode: whether higher priorities should be sorted before or after lower ones. * * Sets whether higher priority values are sorted before or after lower ones. */ void turns_turn_order_set_sort_mode(TurnsTurnOrder * self, TurnsTurnOrderSortMode sort_mode); G_END_DECLS #endif