
/*********************************************************************
 ** Copyright (c) 1992-2022 MAK Technologies, Inc.
 ** All rights reserved.
 *********************************************************************/


/*********************************************************************
 **
 *t  diguyCrowdProfile
 **
 */

#ifndef __diguyCrowdProfile_H
#define __diguyCrowdProfile_H


#ifdef SWIG
%module diguyCrowdProfile
#else
#define CPLUSPLUS_ONLY
#endif

#ifdef CPLUSPLUS_ONLY
class bdiScenarioCrowdProfile;
class diguyAgentParams;
class diguyCharacter;
class diguyCrowd;
#endif


#include <declspec_diguy.h>

/*!
 ** \class diguyCrowdProfile
 ** \ingroup diguyAI
 ** \brief The class that represents the makeup and base params of a diguyCrowd.
*/

/****************************************************************************/
class BDI_DECLSPEC_diguy diguyCrowdProfile
{

public:

/*****************************************************************************/
/**
 *2  General Functions
 **
 **  Unless otherwise specified, all functions callable from:
 **
 *-    - C++
 *-    - Script
 */

   /*l
    *b  Returns:
    **
    **    name of this object; this value will never be NULL
    */
   const char* get_name();

   /*l
    *b  Description:
    **
    **    This function sets the name of this object.
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    */
   int set_name(const char* name);

   /*l
    *b  Returns:
    **
    **    type name of the object; this value will never be NULL
    */
   const char* get_type_name();

   /*l
    *b  Description:
    **
    **    This function creates a new crowd profile entry.  The entry is
    **    initialized with the passed parameters.
    **
    *b  Returns:
    **
    **    the index of the created entry; -1 if no entry created
    **
    *b  Arguments:
    **
    *a    character_type - see set_character_type()
    *a    appearance     - see set_appearance()
    *a    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.
    */
   int create_entry(const char* character_type = NULL,
      const char* appearance = NULL,
      float proportion = 1.0f);

   /*l
    *b  Description:
    **
    **    This function destroys the crowd profile entry at the specified
    **    index.
    */
   void destroy_entry(int entry_index);

   /*l
    *b  Returns:
    **
    **    number of entries in this crowd profile
    */
   int get_num_entries();

   /*l
    *b  Returns:
    **
    **    a random entry index from all entries in this profile; entries
    **    with higher proportions are more likely to be returned
    */
   int get_random_entry_index();

   /*l
    *b  Description:
    **
    **    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)".
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be modified as returned by
    *a                     create_entry()
    *a    character_type - string identifying character type to be associated
    *a                     with this entry; valid values are the same as
    *a                     those that can be passed to
    *a                     diguyScenario::create_character()
    */
   int set_character_type(int entry_index, const char* character_type);

   /*l
    *b  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
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be queried as returned by
    *a                     create_entry()
    */
   const char* get_character_type(int entry_index);

   /*l
    *b  Description:
    **
    **    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".
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be modified as returned by
    *a                     create_entry()
    *a    appearance     - appearance to be associated with the new entry;
    *a                     passing NULL sets appearance to "default"
    */
   int set_appearance(int entry_index, const char* appearance);

   /*l
    *b  Returns:
    **
    **    the appearance of the specified entry; NULL will be returned if
    **    there is no such entry
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be queried as returned by
    *a                     create_entry()

    */
   const char* get_appearance(int entry_index);

   /*l
    *b  Description:
    **
    **    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".
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be modified as returned by
    *a                     create_entry()
    *a    hand_item      - hand_item to be associated with the new entry;
    *a                     passing NULL sets appearance to "default"
    */
   int set_hand_item(int entry_index, const char* hand_item);

   /*l
    *b  Returns:
    **
    **    the hand item of the specified entry; NULL will be returned if
    **    there is no such entry
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be queried as returned by
    *a                     create_entry()
    */
   const char* get_hand_item(int entry_index);

   /*l
    *b  Description:
    **
    **    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".
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    entry_index   - index of entry to be modified as returned by
    *a                    create_entry()
    *a    mind          - mind to be associated with the new entry;
    *a                    passing NULL sets the mind to none
    */
   int set_mind_base_class(int entry_index, const char* mind);


   /*l
    *b  Returns:
    **
    **    the mind of the specified entry; NULL will be returned if
    **    there is no such entry
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be queried as returned by
    *a                     create_entry()
    */
   const char* get_mind_base_class(int entry_index);

   /*l
    *b  Description:
    **
    **    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.
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be modified as returned by
    *a                     create_entry()
    *a    proportion     - how often the new entry should be chosen relative
    *a                     to other entries
    */
   int set_proportion(int entry_index, float proportion);

   /*l
    *b  Returns:
    **
    **    the proportion of the specified entry; 0.0 will be returned if
    **    there is no such entry
    **
    *b  Arguments:
    **
    *a    entry_index    - index of entry to be queried as returned by
    *a                     create_entry()
    */
   float get_proportion(int entry_index);

   /*l
    *b  Description:
    **
    **    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.
    **
    *b  Returns:
    **
    **    0 on success, -1 on failure
    **
    *b  Arguments:
    **
    *a    default_crowd_size - recommended number of characters that should
    *a                         be in a crowd based on this profile
    */
   int set_default_crowd_size(int default_crowd_size);

   /*l
    *b  Returns:
    **
    **    the default crowd size of a crowd based on this profile
    */
   int get_default_crowd_size();

   /*l
    *b  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
    */
   diguyAgentParams* get_default_agent_params();

   /*l
    *b  Returns:
    **
    **    a character that's been created from this profiles template and
    **    added to the crowd specified.
    */
   diguyCharacter * create_character(diguyCrowd * crowd, int is_temporary = 0,
      int create_mind = 1);

/****************************************************************************/
/**
 **2  Experimental Functions
 */
   // Can be 0 or 1 currently
   const char* get_mind_init_argument(int entry_index, int arg);

/****************************************************************************/
/****************************************************************************/
/**
 *2  Deprecated Functions
 **
 **  The following functions are deprecated.
 **
 **  As these functions may disappear in a future version of DI-Guy,
 **   it is recommended that you remove calls to these functions from
 **   your application.
 **
 */
/****************************************************************************/
/****************************************************************************/


/**
 *x  The functions and variables past this point are for internal use only.
 **   No external access to them is expected or necessary.
 */
#ifdef CPLUSPLUS_ONLY

   bdiScenarioCrowdProfile* get_scripted_object() {return m_scripted_object;}

private:

   /*l
    **    A private constructor.
    */
   diguyCrowdProfile(bdiScenarioCrowdProfile* scripted_object);

   /*l
    **    A private destructor.
    */
   virtual ~diguyCrowdProfile();

   /*l
    **    A pointer to internal data.
    */
   bdiScenarioCrowdProfile* m_scripted_object;

   friend class bdiScenarioCrowdProfile;

#endif

};


#endif /* __diguyCrowdProfile_H */


/*********************************************************************
 ** Copyright (c) 1992-2022 MAK Technologies, Inc.
 ** All rights reserved.
 *********************************************************************/

