DI-Guy SDK Documentation  13.2
diguyFormation.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2019 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyFormation
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyFormation_H
15 #define __diguyFormation_H
16 
17 #ifdef SWIG
18 %module diguyFormation
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 
25 class bdiScenarioFormation;
26 class diguyFormation;
27 class diguyCharacter;
28 
29 #endif
30 
31 
32 #include <declspec_diguy.h>
33 
42 /****************************************************************************/
43 class BDI_DECLSPEC_diguy diguyFormation
44 {
45 
46 public:
47 /*****************************************************************************/
57  /*l
58  *b Description:
59  **
60  ** Returns the name of the object. This pointer will never be NULL.
61  **
62  *b Returns:
63  **
64  ** name of the object
65  */
66  const char* get_name();
67 
68  /*l
69  *b Description:
70  **
71  ** This function sets the name of this object.
72  **
73  *b Returns:
74  **
75  ** 0 on success, -1 on failure
76  */
77  int set_name(const char* name);
78 
79  /*l
80  *b Returns:
81  **
82  ** type name of the object; this value will never be NULL
83  */
84  const char* get_type_name();
85 
86 
87  /*l
88  *b Returns:
89  **
90  ** guide name used by this formation
91  */
92  const char* get_guide_name();
93 
94  /*l
95  *b Description:
96  **
97  ** Sets number of followers in the formation.
98  **
99  *b Arguments:
100  **
101  *a number - number of followers in this formation
102  **
103  *b Returns:
104  **
105  ** 0 if success
106  */
107  int set_num_followers(int number);
108 
109  /*l
110  *b Returns:
111  **
112  ** number of members of formation (leader not included)
113  */
114  int get_num_followers();
115 
116  /*l
117  *b Description:
118  **
119  ** Sets rz offset of member relative to leader.
120  **
121  *b Arguments:
122  **
123  *a follower_index - index of follower to modify
124  *a rz - orientation of member relative to leader, in
125  *a degrees
126  **
127  *b Returns:
128  **
129  ** 0 if success
130  */
131  int set_follower_rz_offset(int follower_index, float rz);
132 
133  /*l
134  *b Description:
135  **
136  ** Creates a string describing the formation, with positions being
137  ** relative to relative_x and relative_y.
138  **
139  *b Arguments:
140  **
141  *a relative_x, relative_y - relative positions in meters
142  **
143  *b Returns:
144  **
145  ** string containing lua script
146  */
147  const char* to_lua_string(float relative_x = 0.0f,
148  float relative_y = 0.0f);
149 
150  /*l
151  *b Description:
152  **
153  ** Gets x offset of formation member relative to leader.
154  **
155  *b Arguments:
156  **
157  *a follower_index - index of follower in formation (does not include leader)
158  **
159  *b Returns:
160  **
161  ** x offset in meters
162  */
163  float get_follower_x_offset(int follower_index);
164 
165  /*l
166  *b Description:
167  **
168  ** Gets y offset of formation member relative to leader.
169  **
170  *b Arguments:
171  **
172  *a follower_index - index of follower in formation (does not include leader)
173  **
174  *b Returns:
175  **
176  ** y offset in meters
177  */
178  float get_follower_y_offset(int follower_index);
179 
180  /*l
181  *b Description:
182  **
183  ** Gets rz (or yaw) of formation member relative to leader.
184  **
185  *b Arguments:
186  **
187  *a follower_index - index of follower in formation (does not include leader)
188  **
189  *b Returns:
190  **
191  ** rz offset in degrees
192  */
193  float get_follower_rz_offset(int follower_index);
194 
195  /*l
196  *b Description:
197  **
198  ** Sets role name of member.
199  **
200  *b Arguments:
201  **
202  *a follower_index - index of follower to modify
203  *a role_name - new role
204  **
205  *b Returns:
206  **
207  ** 0 if success
208  */
209  int set_role_name(int follower_index, const char* role_name);
210 
211  /*l
212  *b Description:
213  **
214  ** Gets role. Roles generally correlate with a character's carried
215  ** object.
216  **
217  * RYAN: Give a little more information on what roles are, and at
218  * least one example.
219  **
220  *b Arguments:
221  **
222  *a follower_index - index of follower in formation (does not include
223  *a leader)
224  **
225  *b Returns:
226  **
227  ** string containing role, or "character" if specific role specified
228  */
229  const char* get_role_name(int follower_index);
230 
231  /*l
232  *b Arguments:
233  **
234  *a follower_index - index of follower in formation (does not include leader)
235  **
236  *b Returns:
237  **
238  ** string containing name of follower, if defined
239  */
240  const char* get_follower_instance(int follower_index);
241 
242  /*l
243  *b Arguments:
244  **
245  *a follower_index - index of follower in formation (does not include leader)
246  *a string containing name of follower,
247  */
248  int set_follower_instance(int follower_index, const char * name);
249 
250  /*l
251  *b Description:
252  **
253  ** Sets subgroup size. If > 0, this means that there are subgroups
254  ** and that they will be applied.
255  **
256  * RYAN: What is a subgroup? What is it used for? Can there be
257  * only one?
258  **
259  *b Arguments:
260  **
261  *a size - size of subgroup
262  **
263  *b Returns:
264  **
265  ** 0 if success
266  */
267  int set_subgroup_size(int size);
268 
269  /*l
270  *b Description:
271  **
272  ** Gets size of subgroup. If > 0, this means that there are subgroups
273  ** and that they will be applied.
274  **
275  *b Returns:
276  **
277  ** number of followers in subgroup
278  */
279  int get_subgroup_size();
280 
281  /*l
282  *b Description:
283  **
284  ** Get number of subgroups
285  **
286  *b Returns:
287  **
288  ** number of subgroups
289  */
290  int get_num_subgroups();
291 
292  /*l
293  *b Description:
294  **
295  ** Sets index of first subgroup. Any members before this member are
296  ** not in a subgroup.
297  **
298  *b Arguments:
299  **
300  *a index - index of first follower in subgroup
301  **
302  *b Returns:
303  **
304  ** 0 if success
305  */
306  int set_first_subgroup_index(int index);
307 
308  /*l
309  *b Description:
310  **
311  ** Gets index of first formation member that's in a subgroup.
312  **
313  *b Returns:
314  **
315  ** index of formation member
316  */
317  int get_first_subgroup_index();
318 
319  /*l
320  *b Description:
321  **
322  ** Sets x, y offsets of member relative to leader.
323  **
324  *b Arguments:
325  **
326  *a follower_index - index of follower to modify
327  *a x, y - offsets of member relative to leader, in meters
328  **
329  * RYAN: Does follower_index include leader?
330  **
331  *b Returns:
332  **
333  ** 0 if success
334  */
335  int set_follower_offset(int follower_index, float x, float y);
336 
337  /*l
338  *b Returns:
339  **
340  ** radius of formation, in meters
341  **
342  * RYAN: Radius of what? Relative to what? The leader?
343  */
344  float get_radius();
345 
346 
351 #ifdef CPLUSPLUS_ONLY
352  bdiScenarioFormation* get_scripted_object() {return m_scripted_object;}
353 
354 private:
355 
356  /*l
357  ** A private constructor.
358  */
359  diguyFormation(bdiScenarioFormation* formation);
360 
361  /*l
362  ** A pointer to internal data.
363  */
364  bdiScenarioFormation* m_scripted_object;
365 
366  friend class bdiScenarioFormation;
367 
368 #endif
369 
370 };
371 
372 #endif /* __diguyFormation_H */
373 
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:80
A class that represents the layout of a group of characters.
Definition: diguyFormation.h:41