diff options
Diffstat (limited to 'lib/include/turns-participant.h')
| -rw-r--r-- | lib/include/turns-participant.h | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/lib/include/turns-participant.h b/lib/include/turns-participant.h new file mode 100644 index 0000000..28588a7 --- /dev/null +++ b/lib/include/turns-participant.h @@ -0,0 +1,165 @@ +/* + * SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com> + * SPDX-License-Identifier: LGPL-2.1-only + */ + +#ifndef TURNS_PARTICIPANT_H +#define TURNS_PARTICIPANT_H + +#include <glib-object.h> +#include <glib.h> + +G_BEGIN_DECLS + +/** + * TurnsParticipantDisposition: + * @TURNS_PARTICIPANT_DISPOSITION_NEUTRAL: The participant is neutral towards the player characters + * @TURNS_PARTICIPANT_DISPOSITION_FRIENDLY: The participant is friendly towards the player characters + * @TURNS_PARTICIPANT_DISPOSITION_HOSTILE: The participant is hostile towards the player characters + * @TURNS_PARTICIPANT_DISPOSITION_SECRET: The participants disposition towards the player characters is unknown to the players + * + * Orderings that can be applied to the turn order. + * + * See [property@Turns.TurnOrder.sort-mode] + */ + +typedef enum +{ + TURNS_PARTICIPANT_DISPOSITION_NEUTRAL, + TURNS_PARTICIPANT_DISPOSITION_FRIENDLY, + TURNS_PARTICIPANT_DISPOSITION_HOSTILE, + TURNS_PARTICIPANT_DISPOSITION_SECRET, +} TurnsParticipantDisposition; + +GType turns_participant_disposition_get_type(void) G_GNUC_CONST; +#define TURNS_TYPE_PARTICIPANT_DISPOSITION (turns_participant_disposition_get_type()) + +#define TURNS_TYPE_PARTICIPANT turns_participant_get_type() +G_DECLARE_FINAL_TYPE(TurnsParticipant, turns_participant, TURNS, PARTICIPANT, GObject) + +/** + * TurnsParticipant: + * + * Represents an actor or participant in a turn order. + */ + +/** + * turns_participant_new: + * + * Creates a new participant. + * + * Returns: a new `TurnsParticipant` + */ +G_GNUC_WARN_UNUSED_RESULT +TurnsParticipant * turns_participant_new(void); + +/** + * turns_participant_new_with: + * @name: The name of the new instance. + * @priority: The priority of the new instance. + * @disposition: The disposition of the new instance. + * + * Creates a new participant with the given name, priority, and disposition. + * + * Returns: a new `TurnsParticipant` + */ +G_GNUC_WARN_UNUSED_RESULT +TurnsParticipant * turns_participant_new_with(gchar const * name, gfloat priority, TurnsParticipantDisposition disposition); + +/** + * turns_participant_get_active: (get-property active) + * @self: a participant + * + * Gets whether the participant is currently active in a turn order. + */ +G_GNUC_WARN_UNUSED_RESULT +gboolean turns_participant_get_active(TurnsParticipant const * self); + +/** + * turns_participant_get_defeated: (get-property defeated) + * @self: a participant + * + * Gets whether the participant has been defeated. + */ +G_GNUC_WARN_UNUSED_RESULT +gboolean turns_participant_get_defeated(TurnsParticipant const * self); + +/** + * turns_participant_get_disposition: (get-property disposition) + * @self: a participant + * + * Gets the disposition of the participant towards the players. + */ +G_GNUC_WARN_UNUSED_RESULT +TurnsParticipantDisposition turns_participant_get_disposition(TurnsParticipant const * self); + +/** + * turns_participant_get_id: + * @self: a participant + * + * Gets the unique id of the participant. + */ +G_GNUC_WARN_UNUSED_RESULT +gchar const * turns_participant_get_id(TurnsParticipant const * self); + +/** + * turns_participant_get_name: (get-property name) + * @self: a participant + * + * Gets the name of the participant. + */ +G_GNUC_WARN_UNUSED_RESULT +gchar const * turns_participant_get_name(TurnsParticipant const * self); + +/** + * turns_participant_get_priority: (get-property priority) + * @self: a participant + * + * Gets the priority of the participant. + */ +G_GNUC_WARN_UNUSED_RESULT +gfloat turns_participant_get_priority(TurnsParticipant const * self); + +/** + * turns_participant_set_active: (set-property active) + * @self: a participant + * + * Sets whether the participant is currently active in a turn order. + */ +void turns_participant_set_active(TurnsParticipant * self, gboolean value); + +/** + * turns_participant_set_defeated: (set-property defeated) + * @self: a participant + * + * Sets whether the participant has been defeated. + */ +void turns_participant_set_defeated(TurnsParticipant * self, gboolean value); + +/** + * turns_participant_set_disposition: (set-property disposition) + * @self: a participant + * + * Sets the disposition of the participant towards the players. + */ +void turns_participant_set_disposition(TurnsParticipant * self, TurnsParticipantDisposition value); + +/** + * turns_participant_set_name: (set-property name) + * @self: a participant + * + * Sets the name of the participant. + */ +void turns_participant_set_name(TurnsParticipant * self, gchar const * value); + +/** + * turns_participant_set_priority: (set-property priority) + * @self: a participant + * + * Sets the priority of the participant. + */ +void turns_participant_set_priority(TurnsParticipant * self, gfloat value); + +G_END_DECLS + +#endif |
