![]() |
DI-Guy SDK Documentation
13.8
|
The class that represents the makeup and base params of a diguyCrowd. More...
#include <diguyCrowdProfile.h>
Public Member Functions | |
General Functions | |
Unless otherwise specified, all functions callable from:
| |
| const char * | get_name () |
| Returns: name of this object; this value will never be NULL. More... | |
| int | set_name (const char *name) |
| This function sets the name of this object. More... | |
| const char * | get_type_name () |
| Returns: type name of the object; this value will never be NULL. More... | |
| int | create_entry (const char *character_type=NULL, const char *appearance=NULL, float proportion=1.0f) |
| This function creates a new crowd profile entry. More... | |
| void | destroy_entry (int entry_index) |
| This function destroys the crowd profile entry at the specified index. More... | |
| int | get_num_entries () |
| Returns: number of entries in this crowd profile. More... | |
| int | get_random_entry_index () |
| Returns: a random entry index from all entries in this profile; entries with higher proportions are more likely to be returned. More... | |
| int | set_character_type (int entry_index, const char *character_type) |
| This function sets the character type of the given entry. More... | |
| const char * | get_character_type (int entry_index) |
| Returns: the character type of the specified entry; "(none)" if there is no such entry, or if the specified entry has not yet had its character type set. More... | |
| int | set_appearance (int entry_index, const char *appearance) |
| This function sets the appearance of the given entry. More... | |
| const char * | get_appearance (int entry_index) |
| Returns: the appearance of the specified entry; NULL will be returned if there is no such entry. More... | |
| int | set_hand_item (int entry_index, const char *hand_item) |
| This function sets the hand item of the given entry. More... | |
| const char * | get_hand_item (int entry_index) |
| Returns: the hand item of the specified entry; NULL will be returned if there is no such entry. More... | |
| int | set_mind_base_class (int entry_index, const char *mind) |
| This function sets the mind of the given entry. More... | |
| const char * | get_mind_base_class (int entry_index) |
| Returns: the mind of the specified entry; NULL will be returned if there is no such entry. More... | |
| int | set_proportion (int entry_index, float proportion) |
| This function sets the proportion of the given entry. More... | |
| float | get_proportion (int entry_index) |
| Returns: the proportion of the specified entry; 0.0 will be returned if there is no such entry. More... | |
| int | set_default_crowd_size (int default_crowd_size) |
| This function sets the default crowd size (i.e., number of characters) of a crowd that is created using this profile. More... | |
| int | get_default_crowd_size () |
| Returns: the default crowd size of a crowd based on this profile. More... | |
| diguyAgentParams * | get_default_agent_params () |
| Returns: the default agent parameters that will be used for crowd members of crowds created using this profile; the parameters can be modified using function calls of the diguyAgentParams class. More... | |
| diguyCharacter * | create_character (diguyCrowd *crowd, int is_temporary=0, int create_mind=1) |
| Returns: a character that's been created from this profiles template and added to the crowd specified. More... | |
Experimental Functions | |
| const char * | get_mind_init_argument (int entry_index, int arg) |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiScenarioCrowdProfile * | m_scripted_object |
| A pointer to internal data. More... | |
| class | bdiScenarioCrowdProfile |
| bdiScenarioCrowdProfile * | get_scripted_object () |
| diguyCrowdProfile (bdiScenarioCrowdProfile *scripted_object) | |
| A private constructor. More... | |
| virtual | ~diguyCrowdProfile () |
| A private destructor. More... | |
The class that represents the makeup and base params of a diguyCrowd.
|
private |
A private constructor.
|
privatevirtual |
A private destructor.
| const char* diguyCrowdProfile::get_name | ( | ) |
Returns: name of this object; this value will never be NULL.
| int diguyCrowdProfile::set_name | ( | const char * | name | ) |
This function sets the name of this object.
Returns:
0 on success, -1 on failure
| const char* diguyCrowdProfile::get_type_name | ( | ) |
Returns: type name of the object; this value will never be NULL.
| int diguyCrowdProfile::create_entry | ( | const char * | character_type = NULL, |
| const char * | appearance = NULL, |
||
| float | proportion = 1.0f |
||
| ) |
This function creates a new crowd profile entry.
The entry is initialized with the passed parameters.
Returns:
the index of the created entry; -1 if no entry created
| character_type | see set_character_type() |
| appearance | see set_appearance() |
| proportion | see set_proportion() |
If NULL is passed for character_type, the set_character_type() function must be called with a valid character type before this new entry is valid.
| void diguyCrowdProfile::destroy_entry | ( | int | entry_index | ) |
This function destroys the crowd profile entry at the specified index.
| int diguyCrowdProfile::get_num_entries | ( | ) |
Returns: number of entries in this crowd profile.
| int diguyCrowdProfile::get_random_entry_index | ( | ) |
Returns: a random entry index from all entries in this profile; entries with higher proportions are more likely to be returned.
| int diguyCrowdProfile::set_character_type | ( | int | entry_index, |
| const char * | character_type | ||
| ) |
This function sets the character type of the given entry.
This character type will be used for some characters in crowds created using this crowd profile.
On creation, the character type is set to "(none)".
Returns:
0 on success, -1 on failure
| entry_index | index of entry to be modified as returned by create_entry() |
| character_type | string identifying character type to be associated with this entry; valid values are the same as those that can be passed to diguyScenario::create_character() |
| const char* diguyCrowdProfile::get_character_type | ( | int | entry_index | ) |
Returns: the character type of the specified entry; "(none)" if there is no such entry, or if the specified entry has not yet had its character type set.
| entry_index | index of entry to be queried as returned by create_entry() |
| int diguyCrowdProfile::set_appearance | ( | int | entry_index, |
| const char * | appearance | ||
| ) |
This function sets the appearance of the given entry.
This appearance will be used for some characters in crowds created using this crowd profile.
On creation, the appearance is set to "default".
Returns:
0 on success, -1 on failure
| entry_index | index of entry to be modified as returned by create_entry() |
| appearance | appearance to be associated with the new entry; passing NULL sets appearance to "default" |
| const char* diguyCrowdProfile::get_appearance | ( | int | entry_index | ) |
Returns: the appearance of the specified entry; NULL will be returned if there is no such entry.
| entry_index | index of entry to be queried as returned by create_entry() |
| int diguyCrowdProfile::set_hand_item | ( | int | entry_index, |
| const char * | hand_item | ||
| ) |
This function sets the hand item of the given entry.
This hand item will be used for some characters in crowds created using this crowd profile.
On creation, the hand item is set to "default".
Returns:
0 on success, -1 on failure
| entry_index | index of entry to be modified as returned by create_entry() |
| hand_item | hand_item to be associated with the new entry; passing NULL sets appearance to "default" |
| const char* diguyCrowdProfile::get_hand_item | ( | int | entry_index | ) |
Returns: the hand item of the specified entry; NULL will be returned if there is no such entry.
| entry_index | index of entry to be queried as returned by create_entry() |
| int diguyCrowdProfile::set_mind_base_class | ( | int | entry_index, |
| const char * | mind | ||
| ) |
This function sets the mind of the given entry.
This mind will be used for some characters in crowds created using this crowd profile.
On creation, the mind is set to "none".
Returns:
0 on success, -1 on failure
| entry_index | index of entry to be modified as returned by create_entry() |
| mind | mind to be associated with the new entry; passing NULL sets the mind to none |
| const char* diguyCrowdProfile::get_mind_base_class | ( | int | entry_index | ) |
Returns: the mind of the specified entry; NULL will be returned if there is no such entry.
| entry_index | index of entry to be queried as returned by create_entry() |
| int diguyCrowdProfile::set_proportion | ( | int | entry_index, |
| float | proportion | ||
| ) |
This function sets the proportion of the given entry.
The proportion affects show often the specified entry will be chosen for get_random_entry_index() calls. Entries with higher proportions will be chosen more often than those with lower proportions.
The default proportion for a new entry is 1.0.
Returns:
0 on success, -1 on failure
| entry_index | index of entry to be modified as returned by create_entry() |
| proportion | how often the new entry should be chosen relative to other entries |
| float diguyCrowdProfile::get_proportion | ( | int | entry_index | ) |
Returns: the proportion of the specified entry; 0.0 will be returned if there is no such entry.
| entry_index | index of entry to be queried as returned by create_entry() |
| int diguyCrowdProfile::set_default_crowd_size | ( | int | default_crowd_size | ) |
This function sets the default crowd size (i.e., number of characters) of a crowd that is created using this profile.
The default crowd size of a crowd profile is 20.
Returns:
0 on success, -1 on failure
| default_crowd_size | recommended number of characters that should be in a crowd based on this profile |
| int diguyCrowdProfile::get_default_crowd_size | ( | ) |
Returns: the default crowd size of a crowd based on this profile.
| diguyAgentParams* diguyCrowdProfile::get_default_agent_params | ( | ) |
Returns: the default agent parameters that will be used for crowd members of crowds created using this profile; the parameters can be modified using function calls of the diguyAgentParams class.
| diguyCharacter* diguyCrowdProfile::create_character | ( | diguyCrowd * | crowd, |
| int | is_temporary = 0, |
||
| int | create_mind = 1 |
||
| ) |
Returns: a character that's been created from this profiles template and added to the crowd specified.
| const char* diguyCrowdProfile::get_mind_init_argument | ( | int | entry_index, |
| int | arg | ||
| ) |
|
inline |
|
friend |
|
private |
A pointer to internal data.