DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyFormation.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2014 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 
34 /****************************************************************************/
35 class BDI_DECLSPEC_diguy diguyFormation
36 {
37 
38 public:
39 
40  /*l
41  *b Description:
42  **
43  ** Returns the name of the object. This pointer will never be NULL.
44  **
45  *b Returns:
46  **
47  ** name of the object
48  **
49  *b Callable From:
50  **
51  *- - C++
52  *- - Script
53  */
54  const char* get_name();
55 
56  /*l
57  *b Description:
58  **
59  ** This function sets the name of this object.
60  **
61  *b Returns:
62  **
63  ** 0 on success, -1 on failure
64  **
65  *b Callable From:
66  **
67  *- - C++
68  *- - Script
69  */
70  int set_name(const char* name);
71 
72  /*l
73  *b Returns:
74  **
75  ** type name of the object; this value will never be NULL
76  **
77  *b Callable From:
78  **
79  *- - C++
80  *- - Script
81  */
82  const char* get_type_name();
83 
84 
85  /*l
86  *b Returns:
87  **
88  ** guide name used by this formation
89  **
90  *b Callable From:
91  **
92  *- - C++
93  *- - Script
94  */
95  const char* get_guide_name();
96 
97  /*l
98  *b Description:
99  **
100  ** Sets number of followers in the formation.
101  **
102  *b Arguments:
103  **
104  *a number - number of followers in this formation
105  **
106  *b Returns:
107  **
108  ** 0 if success
109  **
110  *b Callable From:
111  **
112  *- - C++
113  *- - Script
114  */
115  int set_num_followers(int number);
116 
117  /*l
118  *b Returns:
119  **
120  ** number of members of formation (leader not included)
121  **
122  *b Callable From:
123  **
124  *- - C++
125  *- - Script
126  */
127  int get_num_followers();
128 
129  /*l
130  *b Description:
131  **
132  ** Sets rz offset of member relative to leader.
133  **
134  *b Arguments:
135  **
136  *a follower_index - index of follower to modify
137  *a rz - orientation of member relative to leader, in
138  *a degrees
139  **
140  *b Returns:
141  **
142  ** 0 if success
143  **
144  *b Callable From:
145  **
146  *- - C++
147  *- - Script
148  */
149  int set_follower_rz_offset(int follower_index, float rz);
150 
151  /*l
152  *b Description:
153  **
154  ** Creates a string describing the formation, with positions being
155  ** relative to relative_x and relative_y.
156  **
157  *b Arguments:
158  **
159  *a relative_x, relative_y - relative positions in meters
160  **
161  *b Returns:
162  **
163  ** string containing lua script
164  **
165  *b Callable From:
166  **
167  *- - C++
168  *- - Script
169  */
170  const char* to_lua_string(float relative_x = 0.0f,
171  float relative_y = 0.0f);
172 
173  /*l
174  *b Description:
175  **
176  ** Gets x offset of formation member relative to leader.
177  **
178  *b Arguments:
179  **
180  *a follower_index - index of follower in formation (does not include
181  *a leader)
182  **
183  *b Returns:
184  **
185  ** x offset in meters
186  **
187  *b Callable From:
188  **
189  *- - C++
190  *- - Script
191  */
192  float get_follower_x_offset(int follower_index);
193 
194  /*l
195  *b Description:
196  **
197  ** Gets y offset of formation member relative to leader.
198  **
199  *b Arguments:
200  **
201  *a follower_index - index of follower in formation (does not include
202  *a leader)
203  **
204  *b Returns:
205  **
206  ** y offset in meters
207  **
208  *b Callable From:
209  **
210  *- - C++
211  *- - Script
212  */
213  float get_follower_y_offset(int follower_index);
214 
215  /*l
216  *b Description:
217  **
218  ** Gets rz (or yaw) of formation member relative to leader.
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  ** rz offset in degrees
228  **
229  *b Callable From:
230  **
231  *- - C++
232  *- - Script
233  */
234  float get_follower_rz_offset(int follower_index);
235 
236  /*l
237  *b Description:
238  **
239  ** Sets role name of member.
240  **
241  *b Arguments:
242  **
243  *a follower_index - index of follower to modify
244  *a role_name - new role
245  **
246  *b Returns:
247  **
248  ** 0 if success
249  **
250  *b Callable From:
251  **
252  *- - C++
253  *- - Script
254  */
255  int set_role_name(int follower_index, const char* role_name);
256 
257  /*l
258  *b Description:
259  **
260  ** Gets role. Roles generally correlate with a character's carried
261  ** object.
262  **
263  * RYAN: Give a little more information on what roles are, and at
264  * least one example.
265  **
266  *b Arguments:
267  **
268  *a follower_index - index of follower in formation (does not include
269  *a leader)
270  **
271  *b Returns:
272  **
273  ** string containing role, or "character" if specific role specified
274  **
275  *b Callable From:
276  **
277  *- - C++
278  *- - Script
279  */
280  const char* get_role_name(int follower_index);
281 
282  /*l
283  *b Arguments:
284  **
285  *a follower_index - index of follower in formation (does not include
286  *a leader)
287  **
288  *b Returns:
289  **
290  ** string containing name of follower, if defined
291  **
292  *b Callable From:
293  **
294  *- - C++
295  *- - Script
296  */
297  const char* get_follower_instance(int follower_index);
298 
299  /*l
300  *b Description:
301  **
302  ** Sets subgroup size. If > 0, this means that there are subgroups
303  ** and that they will be applied.
304  **
305  * RYAN: What is a subgroup? What is it used for? Can there be
306  * only one?
307  **
308  *b Arguments:
309  **
310  *a size - size of subgroup
311  **
312  *b Returns:
313  **
314  ** 0 if success
315  **
316  *b Callable From:
317  **
318  *- - C++
319  *- - Script
320  */
321  int set_subgroup_size(int size);
322 
323  /*l
324  *b Description:
325  **
326  ** Gets size of subgroup. If > 0, this means that there are subgroups
327  ** and that they will be applied.
328  **
329  *b Returns:
330  **
331  ** number of followers in subgroup
332  **
333  *b Callable From:
334  **
335  *- - C++
336  *- - Script
337  */
338  int get_subgroup_size();
339 
340  /*l
341  *b Description:
342  **
343  ** Get number of subgroups
344  **
345  *b Returns:
346  **
347  ** number of subgroups
348  **
349  *b Callable From:
350  **
351  *- - C++
352  *- - Script
353  */
354  int get_num_subgroups();
355 
356  /*l
357  *b Description:
358  **
359  ** Sets index of first subgroup. Any members before this member are
360  ** not in a subgroup.
361  **
362  *b Arguments:
363  **
364  *a index - index of first follower in subgroup
365  **
366  *b Returns:
367  **
368  ** 0 if success
369  **
370  *b Callable From:
371  **
372  *- - C++
373  *- - Script
374  */
375  int set_first_subgroup_index(int index);
376 
377  /*l
378  *b Description:
379  **
380  ** Gets index of first formation member that's in a subgroup.
381  **
382  *b Returns:
383  **
384  ** index of formation member
385  **
386  *b Callable From:
387  **
388  *- - C++
389  *- - Script
390  */
391  int get_first_subgroup_index();
392 
393  /*l
394  *b Description:
395  **
396  ** Sets x, y offsets of member relative to leader.
397  **
398  *b Arguments:
399  **
400  *a follower_index - index of follower to modify
401  *a x, y - offsets of member relative to leader, in meters
402  **
403  * RYAN: Does follower_index include leader?
404  **
405  *b Returns:
406  **
407  ** 0 if success
408  **
409  *b Callable From:
410  **
411  *- - C++
412  *- - Script
413  */
414  int set_follower_offset(int follower_index, float x, float y);
415 
416  /*l
417  *b Returns:
418  **
419  ** radius of formation, in meters
420  **
421  * RYAN: Radius of what? Relative to what? The leader?
422  **
423  *b Callable From:
424  **
425  *- - C++
426  *- - Script
427  */
428  float get_radius();
429 
430 
435 #ifdef CPLUSPLUS_ONLY
436  bdiScenarioFormation* get_scripted_object() {return m_scripted_object;}
437 
438 private:
439 
440  /*l
441  ** A private constructor.
442  */
443  diguyFormation(bdiScenarioFormation* formation);
444 
445  /*l
446  ** A pointer to internal data.
447  */
448  bdiScenarioFormation* m_scripted_object;
449 
450  friend class bdiScenarioFormation;
451 
452 #endif
453 
454 };
455 
456 #endif /* __diguyFormation_H */
457