project_files/frontlib/model/team.h
changeset 7320 e704706008d4
parent 7314 6171f0bad318
child 7470 0db1780ca938
equal deleted inserted replaced
7318:a446eafcddeb 7320:e704706008d4
    61 	int initialHealth;
    61 	int initialHealth;
    62 	flib_weaponset *weaponset;
    62 	flib_weaponset *weaponset;
    63 } flib_hog;
    63 } flib_hog;
    64 
    64 
    65 typedef struct {
    65 typedef struct {
    66 	int _referenceCount;
       
    67 	flib_hog hogs[HEDGEHOGS_PER_TEAM];
    66 	flib_hog hogs[HEDGEHOGS_PER_TEAM];
    68 	char *name;
    67 	char *name;
    69 	char *grave;
    68 	char *grave;
    70 	char *fort;
    69 	char *fort;
    71 	char *voicepack;
    70 	char *voicepack;
    93  * The new team is pre-filled with default settings (see hwconsts.h)
    92  * The new team is pre-filled with default settings (see hwconsts.h)
    94  */
    93  */
    95 flib_team *flib_team_create(const char *name);
    94 flib_team *flib_team_create(const char *name);
    96 
    95 
    97 /**
    96 /**
       
    97  * Free all memory associated with the team
       
    98  */
       
    99 void flib_team_destroy(flib_team *team);
       
   100 
       
   101 /**
    98  * Loads a team, returns NULL on error.
   102  * Loads a team, returns NULL on error.
    99  */
   103  */
   100 flib_team *flib_team_from_ini(const char *filename);
   104 flib_team *flib_team_from_ini(const char *filename);
   101 
   105 
   102 /**
   106 /**
   120  * Set the same initial health for every hog.
   124  * Set the same initial health for every hog.
   121  */
   125  */
   122 void flib_team_set_health(flib_team *team, int health);
   126 void flib_team_set_health(flib_team *team, int health);
   123 
   127 
   124 /**
   128 /**
   125  * Increase the reference count of the object. Call this if you store a pointer to it somewhere.
       
   126  * Returns the parameter.
       
   127  */
       
   128 flib_team *flib_team_retain(flib_team *team);
       
   129 
       
   130 /**
       
   131  * Decrease the reference count of the object and free it if this was the last reference.
       
   132  */
       
   133 void flib_team_release(flib_team *team);
       
   134 
       
   135 /**
       
   136  * Create a deep copy of a team. Returns NULL on failure.
   129  * Create a deep copy of a team. Returns NULL on failure.
   137  * The referenced weaponsets are not copied, so the new
   130  * The referenced weaponsets are not copied, so the new
   138  * team references the same weaponsets.
   131  * team references the same weaponsets.
   139  */
   132  */
   140 flib_team *flib_team_copy(const flib_team *team);
   133 flib_team *flib_team_copy(const flib_team *team);