27#define SAVE_ALIENCARGO_ITEM "cargo"
28#define SAVE_ALIENCARGO_TEAMDEFID "teamdefid"
29#define SAVE_ALIENCARGO_ALIVE "alive"
30#define SAVE_ALIENCARGO_DEAD "dead"
42 if (alive == 0 && dead == 0)
46 if (item->teamDef != team)
49 if (alive + item->alive < 0)
51 if (dead + item->dead < 0)
60 if (item->alive == 0 && item->dead == 0)
61 cgi->LIST_Remove(&this->
cargo, (
void*)item);
66 if (alive < 0 || dead < 0)
71 if (
cgi->LIST_Add(&this->cargo, (
const void*)&cargoItem,
sizeof(cargoItem))) {
90 const teamDef_t* team =
cgi->Com_GetTeamDefinitionByID(teamId);
93 return this->
add(team, alive, dead);
106 if (item->teamDef != team)
123 if (item->teamDef != team)
155 if (!
cgi->LIST_Add(&listing, (
void*)item,
sizeof(*item))) {
156 cgi->LIST_Delete(&listing);
178 if (!
add(teamId, alive, dead))
179 cgi->Com_Printf(
"AlienCargo::load: Could add aliens to cargo: %s, %d, %d\n", teamId, alive, dead);
219 if (
cgi->LIST_Add(&this->cargo, (
void*)cargoItem,
sizeof(*cargoItem))) {
221 this->
sumDead += cargoItem->dead;
#define SAVE_ALIENCARGO_DEAD
#define SAVE_ALIENCARGO_ALIVE
#define SAVE_ALIENCARGO_TEAMDEFID
#define SAVE_ALIENCARGO_ITEM
Alien cargo class header.
int getAlive(void) const
Return number of all alive aliens in the cargo.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the cargo by teamDef.
linkedList_t * list(void) const
Returns a copy of the cargo list.
virtual ~AlienCargo(void)
Destroys AlienCargo with it's internal data.
bool load(xmlNode_t *root)
Load alien cargo from xml savegame.
bool save(xmlNode_t *root) const
Save alien cargo to xml savegame.
AlienCargo(void)
Creates and initializes AlienCargo object.
int getDead(void) const
Return number of all dead bodies in the cargo.
const cgame_import_t * cgi
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...