UFO: Alien Invasion
|
Go to the source code of this file.
Data Structures | |
struct | capacities_s |
Store capacities in base. More... | |
Macros | |
#define | CAP_Get(base, capacity) &((base)->capacities[(capacity)]) |
Capacity macros. More... | |
#define | CAP_GetMax(base, capacity) (base)->capacities[(capacity)].max |
#define | CAP_GetCurrent(base, capacity) (base)->capacities[(capacity)].cur |
Typedefs | |
typedef struct capacities_s | capacities_t |
Store capacities in base. More... | |
Enumerations | |
enum | baseCapacities_t { CAP_ALIENS, CAP_AIRCRAFT_SMALL, CAP_AIRCRAFT_BIG, CAP_EMPLOYEES, CAP_ITEMS, CAP_LABSPACE, CAP_WORKSPACE, CAP_ANTIMATTER, MAX_CAP } |
All possible capacities in base. More... | |
Functions | |
void | CAP_UpdateStorageCap (struct base_s *base) |
Update Storage Capacity. More... | |
void | CAP_SetMax (struct base_s *base, baseCapacities_t capacity, int value) |
Sets the maximal capacity on a base. More... | |
void | CAP_AddMax (struct base_s *base, baseCapacities_t capacity, int value) |
Changes the maximal capacity on a base. More... | |
void | CAP_SetCurrent (struct base_s *base, baseCapacities_t capacity, int value) |
Sets the current (used) capacity on a base. More... | |
void | CAP_AddCurrent (struct base_s *base, baseCapacities_t capacity, int value) |
Changes the current (used) capacity on a base. More... | |
void | CAP_RemoveAntimatterExceedingCapacity (struct base_s *base) |
Remove exceeding antimatter if an antimatter tank has been destroyed. More... | |
int | CAP_GetFreeCapacity (const struct base_s *base, baseCapacities_t cap) |
void | CAP_CheckOverflow (void) |
Checks capacity overflows on bases. More... | |
#define CAP_Get | ( | base, | |
capacity | |||
) | &((base)->capacities[(capacity)]) |
Capacity macros.
Definition at line 50 of file cp_capacity.h.
Referenced by AC_LoadXML(), AL_AddAliens(), B_AddAntimatter(), B_AddToStorage(), B_ListBuildings_f(), B_LoadXML(), B_UpdateBaseCapacities(), CAP_CheckOverflow(), CAP_GetFreeCapacity(), PR_UpdateProductionCap(), and TR_DestinationCapacityList_f().
#define CAP_GetCurrent | ( | base, | |
capacity | |||
) | (base)->capacities[(capacity)].cur |
Definition at line 52 of file cp_capacity.h.
Referenced by AC_Init_f(), AC_KillExceeding_f(), B_AntimatterInBase(), B_BuildingOpenAfterClick_f(), B_Destroy_AntimaterStorage_f(), CAP_RemoveAntimatterExceedingCapacity(), PR_ProductionList_f(), and TEST_F().
#define CAP_GetMax | ( | base, | |
capacity | |||
) | (base)->capacities[(capacity)].max |
Definition at line 51 of file cp_capacity.h.
Referenced by AC_Init_f(), AC_KillExceeding_f(), B_BuildingOpenAfterClick_f(), B_UpdateBaseCapacities(), BS_FillMarket_f(), CAP_RemoveAntimatterExceedingCapacity(), E_UpdateGUICount_f(), PR_ProductionInfo(), PR_ProductionList_f(), PR_WorkersAvailable(), RS_Change_f(), RS_FillTechnologyList_f(), RS_Max_f(), and RS_Stop_f().
typedef struct capacities_s capacities_t |
Store capacities in base.
enum baseCapacities_t |
All possible capacities in base.
Definition at line 27 of file cp_capacity.h.
void CAP_AddCurrent | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Changes the current (used) capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | Capacity to add to the current (used) capacity value (negative to decrease) |
Definition at line 108 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::cur.
Referenced by AIR_Add(), AIR_Delete(), AIR_MoveAircraftIntoNewHomebase(), CAP_UpdateStorageCap(), CP_SpawnRescueMission(), E_HireEmployee(), E_MoveIntoNewBase(), RS_AssignScientist(), RS_RemoveScientist(), TR_TransferStart(), and Employee::unhire().
void CAP_AddMax | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Changes the maximal capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | Capacity to add to the maximal capacity value (negative to decrease) |
Definition at line 86 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::max.
Referenced by B_UpdateBaseCapacities().
Checks capacity overflows on bases.
Definition at line 129 of file cp_capacity.cpp.
References _, B_GetBuildingTemplateByType(), B_GetBuildingTypeByCapacity(), B_GetNext(), BASE_DESTROYED, base_s::baseStatus, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, CAP_ALIENS, CAP_ANTIMATTER, CAP_EMPLOYEES, CAP_Get, CAP_ITEMS, CAP_LABSPACE, CAP_RemoveAntimatterExceedingCapacity(), CAP_WORKSPACE, cgi, CP_GameTimeStop(), capacities_s::cur, i, base_s::idx, capacities_s::max, MAX_CAP, building_s::name, base_s::name, PR_UpdateProductionCap(), and RS_RemoveScientistsExceedingCapacity().
Referenced by B_BuildingDestroy(), and CP_CampaignRun().
int CAP_GetFreeCapacity | ( | const struct base_s * | base, |
baseCapacities_t | cap | ||
) |
Remove exceeding antimatter if an antimatter tank has been destroyed.
[in] | base | Pointer to the base. |
Definition at line 38 of file cp_capacity.cpp.
References B_AddAntimatter(), CAP_ANTIMATTER, CAP_GetCurrent, and CAP_GetMax.
Referenced by B_Destroy_AntimaterStorage_f(), and CAP_CheckOverflow().
void CAP_SetCurrent | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Sets the current (used) capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | New current (used) capacity value |
Definition at line 97 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::cur.
Referenced by B_Build(), B_Destroy(), B_ResetAllStatusAndCapacities(), B_UpdateAntimatterCap(), CAP_UpdateStorageCap(), and RS_RemoveScientistsExceedingCapacity().
void CAP_SetMax | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Sets the maximal capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | New maximal capacity value |
Definition at line 75 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::max.
Referenced by B_UpdateBaseCapacities().
Update Storage Capacity.
[in] | base | Pointer to the base |
Definition at line 52 of file cp_capacity.cpp.
References B_ItemInBase(), B_ItemIsStoredInBaseStorage(), CAP_AddCurrent(), CAP_ITEMS, CAP_SetCurrent(), cgi, cgame_import_s::csi, E_CountHired(), EMPL_ROBOT, i, INVSH_GetItemByIDX(), csi_s::numODs, objDef_s::size, and UGV_SIZE.
Referenced by B_InitialEquipment(), B_ResetAllStatusAndCapacities(), B_SellOrAddItems(), and CP_BaseAttackMissionDestroyBase().