DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyCrowdProfile.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  **
10  *t diguyCrowdProfile
11  **
12  */
13 
14 #ifndef __diguyCrowdProfile_H
15 #define __diguyCrowdProfile_H
16 
17 
18 #ifdef SWIG
19 %module diguyCrowdProfile
20 #else
21 #define CPLUSPLUS_ONLY
22 #endif
23 
24 #ifdef CPLUSPLUS_ONLY
25 class bdiScenarioCrowdProfile;
26 class diguyAgentParams;
27 class diguyCharacter;
28 class diguyCrowd;
29 #endif
30 
31 
32 #include <declspec_diguy.h>
33 
34 /****************************************************************************/
35 class BDI_DECLSPEC_diguy diguyCrowdProfile
36 {
37 
38 public:
39 
40 /*****************************************************************************/
50  /*l
51  *b Returns:
52  **
53  ** name of this object; this value will never be NULL
54  */
55  const char* get_name();
56 
57  /*l
58  *b Description:
59  **
60  ** This function sets the name of this object.
61  **
62  *b Returns:
63  **
64  ** 0 on success, -1 on failure
65  */
66  int set_name(const char* name);
67 
68  /*l
69  *b Returns:
70  **
71  ** type name of the object; this value will never be NULL
72  */
73  const char* get_type_name();
74 
75  /*l
76  *b Description:
77  **
78  ** This function creates a new crowd profile entry. The entry is
79  ** initialized with the passed parameters.
80  **
81  *b Returns:
82  **
83  ** the index of the created entry; -1 if no entry created
84  **
85  *b Arguments:
86  **
87  *a character_type - see set_character_type()
88  *a appearance - see set_appearance()
89  *a proportion - see set_proportion()
90  **
91  ** If NULL is passed for character_type, the set_character_type()
92  ** function must be called with a valid character type before this
93  ** new entry is valid.
94  */
95  int create_entry(const char* character_type = NULL,
96  const char* appearance = NULL,
97  float proportion = 1.0f);
98 
99  /*l
100  *b Description:
101  **
102  ** This function destroys the crowd profile entry at the specified
103  ** index.
104  */
105  void destroy_entry(int entry_index);
106 
107  /*l
108  *b Returns:
109  **
110  ** number of entries in this crowd profile
111  */
112  int get_num_entries();
113 
114  /*l
115  *b Returns:
116  **
117  ** a random entry index from all entries in this profile; entries
118  ** with higher proportions are more likely to be returned
119  */
120  int get_random_entry_index();
121 
122  /*l
123  *b Description:
124  **
125  ** This function sets the character type of the given entry. This
126  ** character type will be used for some characters in crowds created
127  ** using this crowd profile.
128  **
129  ** On creation, the character type is set to "(none)".
130  **
131  *b Returns:
132  **
133  ** 0 on success, -1 on failure
134  **
135  *b Arguments:
136  **
137  *a entry_index - index of entry to be modified as returned by
138  *a create_entry()
139  *a character_type - string identifying character type to be associated
140  *a with this entry; valid values are the same as
141  *a those that can be passed to
142  *a diguyScenario::create_character()
143  */
144  int set_character_type(int entry_index, const char* character_type);
145 
146  /*l
147  *b Returns:
148  **
149  ** the character type of the specified entry; "(none)" if there is no
150  ** such entry, or if the specified entry has not yet had its character
151  ** type set
152  **
153  *b Arguments:
154  **
155  *a entry_index - index of entry to be queried as returned by
156  *a create_entry()
157  */
158  const char* get_character_type(int entry_index);
159 
160  /*l
161  *b Description:
162  **
163  ** This function sets the appearance of the given entry. This
164  ** appearance will be used for some characters in crowds created
165  ** using this crowd profile.
166  **
167  ** On creation, the appearance is set to "default".
168  **
169  *b Returns:
170  **
171  ** 0 on success, -1 on failure
172  **
173  *b Arguments:
174  **
175  *a entry_index - index of entry to be modified as returned by
176  *a create_entry()
177  *a appearance - appearance to be associated with the new entry;
178  *a passing NULL sets appearance to "default"
179  */
180  int set_appearance(int entry_index, const char* appearance);
181 
182  /*l
183  *b Returns:
184  **
185  ** the appearance of the specified entry; NULL will be returned if
186  ** there is no such entry
187  **
188  *b Arguments:
189  **
190  *a entry_index - index of entry to be queried as returned by
191  *a create_entry()
192 
193  */
194  const char* get_appearance(int entry_index);
195 
196  /*l
197  *b Description:
198  **
199  ** This function sets the hand item of the given entry. This
200  ** hand item will be used for some characters in crowds created
201  ** using this crowd profile.
202  **
203  ** On creation, the hand item is set to "default".
204  **
205  *b Returns:
206  **
207  ** 0 on success, -1 on failure
208  **
209  *b Arguments:
210  **
211  *a entry_index - index of entry to be modified as returned by
212  *a create_entry()
213  *a hand_item - hand_item to be associated with the new entry;
214  *a passing NULL sets appearance to "default"
215  */
216  int set_hand_item(int entry_index, const char* hand_item);
217 
218  /*l
219  *b Returns:
220  **
221  ** the hand item of the specified entry; NULL will be returned if
222  ** there is no such entry
223  **
224  *b Arguments:
225  **
226  *a entry_index - index of entry to be queried as returned by
227  *a create_entry()
228  */
229  const char* get_hand_item(int entry_index);
230 
231  /*l
232  *b Description:
233  **
234  ** This function sets the mind of the given entry. This
235  ** mind will be used for some characters in crowds created
236  ** using this crowd profile.
237  **
238  ** On creation, the mind is set to "none".
239  **
240  *b Returns:
241  **
242  ** 0 on success, -1 on failure
243  **
244  *b Arguments:
245  **
246  *a entry_index - index of entry to be modified as returned by
247  *a create_entry()
248  *a mind - mind to be associated with the new entry;
249  *a passing NULL sets the mind to none
250  */
251  int set_mind_base_class(int entry_index, const char* mind);
252 
253 
254  /*l
255  *b Returns:
256  **
257  ** the mind of the specified entry; NULL will be returned if
258  ** there is no such entry
259  **
260  *b Arguments:
261  **
262  *a entry_index - index of entry to be queried as returned by
263  *a create_entry()
264  */
265  const char* get_mind_base_class(int entry_index);
266 
267  /*l
268  *b Description:
269  **
270  ** This function sets the proportion of the given entry. The
271  ** proportion affects show often the specified entry will be
272  ** chosen for get_random_entry_index() calls. Entries with
273  ** higher proportions will be chosen more often than those with
274  ** lower proportions.
275  **
276  ** The default proportion for a new entry is 1.0.
277  **
278  *b Returns:
279  **
280  ** 0 on success, -1 on failure
281  **
282  *b Arguments:
283  **
284  *a entry_index - index of entry to be modified as returned by
285  *a create_entry()
286  *a proportion - how often the new entry should be chosen relative
287  *a to other entries
288  */
289  int set_proportion(int entry_index, float proportion);
290 
291  /*l
292  *b Returns:
293  **
294  ** the proportion of the specified entry; 0.0 will be returned if
295  ** there is no such entry
296  **
297  *b Arguments:
298  **
299  *a entry_index - index of entry to be queried as returned by
300  *a create_entry()
301  */
302  float get_proportion(int entry_index);
303 
304  /*l
305  *b Description:
306  **
307  ** This function sets the default crowd size (i.e., number of
308  ** characters) of a crowd that is created using this profile.
309  ** The default crowd size of a crowd profile is 20.
310  **
311  *b Returns:
312  **
313  ** 0 on success, -1 on failure
314  **
315  *b Arguments:
316  **
317  *a default_crowd_size - recommended number of characters that should
318  *a be in a crowd based on this profile
319  */
320  int set_default_crowd_size(int default_crowd_size);
321 
322  /*l
323  *b Returns:
324  **
325  ** the default crowd size of a crowd based on this profile
326  */
327  int get_default_crowd_size();
328 
329  /*l
330  *b Returns:
331  **
332  ** the default agent parameters that will be used for crowd members
333  ** of crowds created using this profile; the parameters can be
334  ** modified using function calls of the diguyAgentParams class
335  */
336  diguyAgentParams* get_default_agent_params();
337 
338  /*l
339  *b Returns:
340  **
341  ** a character that's been created from this profiles template and
342  ** added to the crowd specified.
343  */
344  diguyCharacter * create_character(diguyCrowd * crowd, int is_temporary = 0,
345  int create_mind = 1);
346 
347 /****************************************************************************/
351  // Can be 0 or 1 currently
352  const char* get_mind_init_argument(int entry_index, int arg);
353 
354 /****************************************************************************/
355 /****************************************************************************/
366 /****************************************************************************/
367 /****************************************************************************/
369 
374 #ifdef CPLUSPLUS_ONLY
375 
376  bdiScenarioCrowdProfile* get_scripted_object() {return m_scripted_object;}
377 
378 private:
379 
380  /*l
381  ** A private constructor.
382  */
383  diguyCrowdProfile(bdiScenarioCrowdProfile* scripted_object);
384 
385  /*l
386  ** A private destructor.
387  */
388  virtual ~diguyCrowdProfile();
389 
390  /*l
391  ** A pointer to internal data.
392  */
393  bdiScenarioCrowdProfile* m_scripted_object;
394 
395  friend class bdiScenarioCrowdProfile;
396 
397 #endif
398 
399 };
400 
401 
402 #endif /* __diguyCrowdProfile_H */
403 
404 
405 /*********************************************************************
406  ** Copyright (c) 1992-2014 VT MAK
407  ** All rights reserved.
408  *********************************************************************/
409