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