/* * SPDX-FileCopyrightText: 2025 Felix Morgner * SPDX-License-Identifier: LGPL-2.1-only */ #ifndef TURNS_PARTICIPANT_H #define TURNS_PARTICIPANT_H #include #include G_BEGIN_DECLS typedef enum { /** * @brief The participant is neutral towards the player characters. * @since 1.0.0 */ TURNS_PARTICIPANT_DISPOSITION_NEUTRAL, /** * @brief The participant is friendly towards the player characters. * @since 1.0.0 */ TURNS_PARTICIPANT_DISPOSITION_FRIENDLY, /** * @brief The participant is hostile towards the player characters. * @since 1.0.0 */ TURNS_PARTICIPANT_DISPOSITION_HOSTILE, /** * @brief The participants disposition towards the player characters is unknown to the players. * @since 1.0.0 */ 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) /** * @class TurnsParticipant turns-participant.h "turns-participant.h" * @since 1.0.0 * @brief Represents an actor or participant in a turn order. */ /** * @brief Creates a new participant. * @since 1.0.0 * * This functions constructs a default initialized instance, meaning: * - @p name is the empty string * - @p priority is 0.0f * - @p disposition is Disposition.Neutral. * * @return A new @p Turns.Participant */ G_GNUC_WARN_UNUSED_RESULT TurnsParticipant * turns_participant_new(void); /** * @brief Creates a new participant with the given property values. * @since 1.0.0 * * @param name The name of the new instance. (transfer none) - The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. * @param priority The priority of the new instance. * @param disposition The disposition of the new instance. */ G_GNUC_WARN_UNUSED_RESULT TurnsParticipant * turns_participant_new_with(gchar const * name, gfloat priority, TurnsParticipantDisposition disposition); /** * @brief Gets whether the participant is currently active in a turn order. * @since 1.0.0 * * @return The current value of the @p Turns.Participant:active property. */ G_GNUC_WARN_UNUSED_RESULT gboolean turns_participant_get_active(TurnsParticipant const * self); /** * @brief Gets whether the participant has been defeated. * @since 1.0.0 * * @return The current value of the @p Turns.Participant:defeated property. */ G_GNUC_WARN_UNUSED_RESULT gboolean turns_participant_get_defeated(TurnsParticipant const * self); /** * @brief Gets the disposition of the participant. * @since 1.0.0 * * @return The current value of the @p Turns.Participant:disposition property. */ G_GNUC_WARN_UNUSED_RESULT TurnsParticipantDisposition turns_participant_get_disposition(TurnsParticipant const * self); /** * @brief Gets the id of the participant. * @since 1.0.0 * * @return (transfer none) - The id of the participant. */ G_GNUC_WARN_UNUSED_RESULT gchar const * turns_participant_get_id(TurnsParticipant const * self); /** * @brief Gets the name of the participant. * @since 1.0.0 * * @return (transfer none) - The current value of the @p Turns.Participant:name property. */ G_GNUC_WARN_UNUSED_RESULT gchar const * turns_participant_get_name(TurnsParticipant const * self); /** * @brief Get the priority of the participant. * @since 1.0.0 * * @return The current value of the @p Turns.Participant:priority property. */ G_GNUC_WARN_UNUSED_RESULT gfloat turns_participant_get_priority(TurnsParticipant const * self); /** * @brief Sets whether the participant is currently active in a turn order. * @since 1.0.0 * * @param value The new value of the @p Turns.Participant:active property. */ void turns_participant_set_active(TurnsParticipant * self, gboolean value); /** * @brief Set whether the participant has been defeated. * @since 1.0.0 * * @param value The new value of the @p Turns.Participant:defeated property. */ void turns_participant_set_defeated(TurnsParticipant * self, gboolean value); /** * @brief Sets the disposition of the participant. * @since 1.0.0 * * @param value The new value of the @p Turns.Participant:disposition property. */ void turns_participant_set_disposition(TurnsParticipant * self, TurnsParticipantDisposition value); /** * @brief Sets the name of the participant. * @since 1.0.0 * * @param value (transfer none) - The new value of the @p Turns.Participant:active property. */ void turns_participant_set_name(TurnsParticipant * self, gchar const * value); /** * @brief Sets the priority of the participant. * @since 1.0.0 * * @param value The new value of the @p Turns.Participant:priority property. */ void turns_participant_set_priority(TurnsParticipant * self, gfloat value); G_END_DECLS #endif