1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
/*
* 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
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
|