UFO: Alien Invasion
|
Alien containment class. More...
#include <aliencontainment.h>
Inherits AlienCargo.
Public Member Functions | |
virtual bool | add (const teamDef_t *team, int alive, int dead) |
Add aliens to the containment by teamDef. More... | |
virtual bool | add (const char *teamId, int alive, int dead) |
Add aliens to the containment by scripted team ID. More... | |
AlienContainment (capacities_t *aliveCapacity, capacities_t *deadCapacity) | |
Creates and initializes AlienContainment object. More... | |
virtual | ~AlienContainment (void) |
Destroys AlienContainer with it's internal data. More... | |
![]() | |
int | getAlive (const teamDef_t *team) const |
Return number of alive aliens of a type in the cargo. More... | |
int | getDead (const teamDef_t *team) const |
Return number of dead alien bodies of a type in the cargo. More... | |
int | getAlive (void) const |
Return number of all alive aliens in the cargo. More... | |
int | getDead (void) const |
Return number of all dead bodies in the cargo. More... | |
linkedList_t * | list (void) const |
Returns a copy of the cargo list. More... | |
bool | load (xmlNode_t *root) |
Load alien cargo from xml savegame. More... | |
bool | save (xmlNode_t *root) const |
Save alien cargo to xml savegame. More... | |
AlienCargo (void) | |
Creates and initializes AlienCargo object. More... | |
AlienCargo (AlienCargo &alienCargo) | |
Creates and initializes AlienCargo object from another one. More... | |
virtual | ~AlienCargo (void) |
Destroys AlienCargo with it's internal data. More... | |
Static Public Member Functions | |
static bool | isLifeSupported (const teamDef_t *team) |
Returns if storing a specific life form is supported by the containment. More... | |
static int | getCapacityNeedForAlien (const teamDef_t *teamDef, const bool isDead) |
Returns the number of capacity needed for an alien in the containment. More... | |
Protected Attributes | |
capacities_t * | aliveCapacity |
capacities_t * | deadCapacity |
![]() | |
linkedList_t * | cargo |
int | sumAlive |
int | sumDead |
Private Member Functions | |
void | resetCurrentCapacities (void) |
Private metod to reset current capacities. More... | |
Alien containment class.
Definition at line 33 of file aliencontainment.h.
AlienContainment::AlienContainment | ( | capacities_t * | aliveCapacity, |
capacities_t * | deadCapacity | ||
) |
Creates and initializes AlienContainment object.
Definition at line 129 of file aliencontainment.cpp.
References resetCurrentCapacities().
|
virtual |
Destroys AlienContainer with it's internal data.
Definition at line 137 of file aliencontainment.cpp.
References resetCurrentCapacities().
Add aliens to the containment by teamDef.
[in] | team | Pointer to the alien Team Definition |
[in] | alive | Number of alive aliens |
[in] | dead | Number of dead aliens |
Reimplemented from AlienCargo.
Definition at line 86 of file aliencontainment.cpp.
References AlienCargo::add(), aliveCapacity, capacities_s::cur, deadCapacity, AlienCargo::getAlive(), getCapacityNeedForAlien(), AlienCargo::getDead(), isLifeSupported(), RS_GetTechForTeam(), and RS_MarkCollected().
Referenced by AC_KillAll_f(), AC_KillExceeding_f(), AC_KillOne_f(), AC_LoadXML(), add(), AL_AddAliens(), TR_EmptyTransferCargo(), and TR_TransferStart().
Add aliens to the containment by scripted team ID.
[in] | teamId | Scripted team ID string |
[in] | alive | Number of alive aliens |
[in] | dead | Number of dead aliens |
Reimplemented from AlienCargo.
Definition at line 116 of file aliencontainment.cpp.
References add(), cgi, and cgame_import_s::Com_GetTeamDefinitionByID().
|
static |
Returns the number of capacity needed for an alien in the containment.
[in] | teamDef | Pointer to the alien Team Definition |
[in] | isDead | If the alien to calculate for is dead |
Definition at line 37 of file aliencontainment.cpp.
Referenced by AC_KillExceeding_f(), and add().
|
static |
Returns if storing a specific life form is supported by the containment.
[in] | team | Pointer to the alien Team Definition |
Definition at line 57 of file aliencontainment.cpp.
References BREATHINGAPPARATUS_TECH, CHRSH_IsTeamDefAlien(), CHRSH_IsTeamDefRobot(), RS_GetTechByID(), and RS_IsResearched_ptr().
Referenced by add(), and AL_AddAliens().
Private metod to reset current capacities.
Definition at line 45 of file aliencontainment.cpp.
References aliveCapacity, capacities_s::cur, and deadCapacity.
Referenced by AlienContainment(), and ~AlienContainment().
|
protected |
Definition at line 35 of file aliencontainment.h.
Referenced by add(), and resetCurrentCapacities().
|
protected |
Definition at line 36 of file aliencontainment.h.
Referenced by add(), and resetCurrentCapacities().