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
177
178
179
|
/*
* 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>
#include <glibconfig.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_compare:
* @self: A #TurnsParticipant
* @other: A #TurnsParticipant
*
* Compares two participants by priority.
*
* Returns: a new `TurnsParticipant`
*/
G_GNUC_WARN_UNUSED_RESULT
gint turns_participant_compare(TurnsParticipant const * self, TurnsParticipant const * other);
/**
* 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
|