DI-Guy SDK Documentation  13.1
diguyCrowdProfile Class Reference

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:

  • C++
  • Script
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...
 
diguyAgentParamsget_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...
 
diguyCharactercreate_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.

bdiScenarioCrowdProfilem_scripted_object
 A pointer to internal data. More...
 
class bdiScenarioCrowdProfile
 
bdiScenarioCrowdProfileget_scripted_object ()
 
 diguyCrowdProfile (bdiScenarioCrowdProfile *scripted_object)
 A private constructor. More...
 
virtual ~diguyCrowdProfile ()
 A private destructor. More...
 

Detailed Description

The class that represents the makeup and base params of a diguyCrowd.

Constructor & Destructor Documentation

diguyCrowdProfile::diguyCrowdProfile ( bdiScenarioCrowdProfile scripted_object)
private

A private constructor.

virtual diguyCrowdProfile::~diguyCrowdProfile ( )
privatevirtual

A private destructor.

Member Function Documentation

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

Parameters
character_typesee set_character_type()
appearancesee set_appearance()
proportionsee 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

Parameters
entry_indexindex of entry to be modified as returned by create_entry()
character_typestring 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.

Parameters
entry_indexindex 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

Parameters
entry_indexindex of entry to be modified as returned by create_entry()
appearanceappearance 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.

Parameters
entry_indexindex 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

Parameters
entry_indexindex of entry to be modified as returned by create_entry()
hand_itemhand_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.

Parameters
entry_indexindex 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

Parameters
entry_indexindex of entry to be modified as returned by create_entry()
mindmind 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.

Parameters
entry_indexindex 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

Parameters
entry_indexindex of entry to be modified as returned by create_entry()
proportionhow 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.

Parameters
entry_indexindex 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

Parameters
default_crowd_sizerecommended 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 
)
bdiScenarioCrowdProfile* diguyCrowdProfile::get_scripted_object ( )
inline

Friends And Related Function Documentation

friend class bdiScenarioCrowdProfile
friend

Member Data Documentation

bdiScenarioCrowdProfile* diguyCrowdProfile::m_scripted_object
private

A pointer to internal data.


The documentation for this class was generated from the following file: