|
UFO: Alien Invasion
|
UFO recovery and storing. More...
#include "../../DateTime.h"#include "../../cl_shared.h"#include "cp_campaign.h"#include "cp_ufo.h"#include "cp_geoscape.h"#include "cp_time.h"#include "cp_uforecovery.h"#include "cp_uforecovery_callbacks.h"#include "cp_aircraft.h"#include "save/save_uforecovery.h"#include "cp_component.h"
Go to the source code of this file.
Functions | |
| void | UR_ProcessActive (void) |
| Function to process active recoveries. | |
| storedUFO_t * | US_GetStoredUFOByIDX (const int idx) |
| Returns a stored ufo. | |
| storedUFO_t * | US_StoreUFO (const aircraft_t *ufoTemplate, installation_t *installation, DateTime &date, float condition) |
| Adds an UFO to the storage. | |
| void | US_RemoveStoredUFO (storedUFO_t *ufo) |
| Removes an UFO from the storage. | |
| int | US_UFOsInStorage (const aircraft_t *ufoTemplate, const installation_t *installation) |
| Returns the number of UFOs stored (on an installation or anywhere). | |
| void | US_RemoveUFOsExceedingCapacity (installation_t *installation) |
| Removes ufos which are over the storing capacity. | |
| bool | US_TransferUFO (storedUFO_t *ufo, installation_t *ufoyard) |
| Start transferring of a stored UFO. | |
| storedUFO_t * | US_GetClosestStoredUFO (const aircraft_t *ufoTemplate, const base_t *base) |
| get the closest stored ufo (of a type) from a base | |
| int | US_StoredUFOCount (void) |
| Returns the number of storedUFOs. | |
| bool | US_SaveXML (xmlNode_t *p) |
| Save callback for savegames in XML Format. | |
| bool | US_LoadXML (xmlNode_t *p) |
| Load callback for xml savegames. | |
| void | UR_InitStartup (void) |
| Init actions for ufostoring-subsystem. | |
| void | UR_Shutdown (void) |
| Closing actions for ufostoring-subsystem. | |
Variables | |
| static const cmdList_t | debugStoredUfosCmds [] |
UFO recovery and storing.
Definition in file cp_uforecovery.cpp.
Init actions for ufostoring-subsystem.
Definition at line 489 of file cp_uforecovery.cpp.
References cgi, debugStoredUfosCmds, and UR_InitCallbacks().
Referenced by CP_InitStartup().
Function to process active recoveries.
Definition at line 47 of file cp_uforecovery.cpp.
References _, ccs, Com_sprintf(), cp_messageBuffer, MSG_TRANSFERFINISHED, MSO_CheckAddNewMessage(), NT_TRANSFER_UFORECOVERY_FINISHED, RS_MarkCollected(), SUFO_RECOVERED, SUFO_STORED, SUFO_TRANSFERED, UFO_GetName(), and US_Foreach.
Referenced by CP_CampaignRun(), and TEST_F().
Closing actions for ufostoring-subsystem.
Definition at line 498 of file cp_uforecovery.cpp.
References ccs, cgi, debugStoredUfosCmds, and UR_ShutdownCallbacks().
Referenced by CP_Shutdown().
| storedUFO_t * US_GetClosestStoredUFO | ( | const aircraft_t * | ufoTemplate, |
| const base_t * | base ) |
get the closest stored ufo (of a type) from a base
| [in] | ufoTemplate | Pointer to the aircraft (ufo) template to look for (nullptr for any type) |
| [in] | base | Pointer to the base. If it's nullptr the function simply return the first stored UFO of type |
Definition at line 261 of file cp_uforecovery.cpp.
References GetDistanceOnGlobe(), base_t::pos, SUFO_STORED, and US_Foreach.
| storedUFO_t * US_GetStoredUFOByIDX | ( | const int | idx | ) |
Returns a stored ufo.
| [in] | idx | index of the stored UFO |
Definition at line 83 of file cp_uforecovery.cpp.
References US_Foreach.
Referenced by PR_LoadXML(), US_DestroyStoredUFO_f(), US_FillUFOTransfer_f(), US_SelectStoredUfo_f(), and US_TransferUFO_f().
| bool US_LoadXML | ( | xmlNode_t * | p | ) |
Load callback for xml savegames.
| [in] | p | XML Node structure, where we get the information from |
Definition at line 326 of file cp_uforecovery.cpp.
References AIR_GetAircraft(), storedUFO_t::arrive, ccs, cgi, storedUFO_t::comp, COMP_GetComponentsByID(), storedUFO_t::condition, capacities_t::cur, storedUFO_t::disassembly, storedUFO_t::id, installation_t::idx, storedUFO_t::idx, INS_GetByIDX(), storedUFO_t::installation, LIST_Add(), capacities_t::max, Q_strncpyz(), SAVE_STOREDUFOSTATUS_NAMESPACE, SAVE_UFORECOVERY_CONDITION, SAVE_UFORECOVERY_DATE, SAVE_UFORECOVERY_INSTALLATIONIDX, SAVE_UFORECOVERY_STATUS, SAVE_UFORECOVERY_STOREDUFOS, SAVE_UFORECOVERY_UFO, SAVE_UFORECOVERY_UFOID, SAVE_UFORECOVERY_UFOIDX, saveStoredUFOConstants, storedUFO_t::status, installation_t::ufoCapacity, storedUFO_t::ufoTemplate, and xmlNode_t.
Referenced by SAV_Init().
| void US_RemoveStoredUFO | ( | storedUFO_t * | ufo | ) |
Removes an UFO from the storage.
| [in,out] | ufo | stored UFO to remove |
Definition at line 148 of file cp_uforecovery.cpp.
References ccs, cgi, capacities_t::cur, storedUFO_t::disassembly, production_t::idx, storedUFO_t::installation, PR_GetProductionForBase, PR_ProductionBase(), PR_QueueDelete(), PR_QueueNext(), RS_CheckRequirements(), and installation_t::ufoCapacity.
Referenced by PR_FinishDisassembly(), US_DestroyStoredUFO_f(), and US_RemoveUFOsExceedingCapacity().
| void US_RemoveUFOsExceedingCapacity | ( | installation_t * | installation | ) |
Removes ufos which are over the storing capacity.
| [in] | installation | pointer to the ufoyard the ufos are stored in |
Definition at line 202 of file cp_uforecovery.cpp.
References cgi, capacities_t::cur, ERR_DROP, capacities_t::max, installation_t::ufoCapacity, US_Foreach, and US_RemoveStoredUFO().
Referenced by INS_DestroyInstallation().
| bool US_SaveXML | ( | xmlNode_t * | p | ) |
Save callback for savegames in XML Format.
| [out] | p | XML Node structure, where we write the information to |
Definition at line 299 of file cp_uforecovery.cpp.
References cgi, SAVE_STOREDUFOSTATUS_NAMESPACE, SAVE_UFORECOVERY_CONDITION, SAVE_UFORECOVERY_DATE, SAVE_UFORECOVERY_INSTALLATIONIDX, SAVE_UFORECOVERY_STATUS, SAVE_UFORECOVERY_STOREDUFOS, SAVE_UFORECOVERY_UFO, SAVE_UFORECOVERY_UFOID, SAVE_UFORECOVERY_UFOIDX, saveStoredUFOConstants, US_Foreach, and xmlNode_t.
Referenced by SAV_Init().
Returns the number of storedUFOs.
Definition at line 288 of file cp_uforecovery.cpp.
| storedUFO_t * US_StoreUFO | ( | const aircraft_t * | ufoTemplate, |
| installation_t * | installation, | ||
| DateTime & | date, | ||
| float | condition ) |
Adds an UFO to the storage.
| [in] | ufoTemplate | Pointer to the aircraft(ufo)Template to add |
| [in,out] | installation | Pointer to the installation it should be added to |
| [in] | date | Date when UFO is arrives to the storage (recovery || transfer) |
| [in] | condition | Condition of the UFO to store (How much the UFO is damaged) |
Definition at line 100 of file cp_uforecovery.cpp.
References storedUFO_t::arrive, ccs, cgi, storedUFO_t::comp, COMP_GetComponentsByID(), storedUFO_t::condition, capacities_t::cur, DEBUG_CLIENT, storedUFO_t::disassembly, aircraft_t::id, storedUFO_t::id, storedUFO_t::idx, storedUFO_t::installation, LIST_Add(), capacities_t::max, Q_strncpyz(), RS_MarkCollected(), storedUFO_t::status, SUFO_RECOVERED, SUFO_STORED, aircraft_t::tech, installation_t::ufoCapacity, and storedUFO_t::ufoTemplate.
Referenced by TEST_F(), TEST_F(), and UR_DialogStartStore_f().
| bool US_TransferUFO | ( | storedUFO_t * | ufo, |
| installation_t * | ufoyard ) |
Start transferring of a stored UFO.
| [in,out] | ufo | Stored UFO to transfer |
| [in,out] | ufoyard | Destination of the UFO transfer |
Definition at line 225 of file cp_uforecovery.cpp.
References _, storedUFO_t::arrive, ccs, cgi, Com_sprintf(), cp_messageBuffer, capacities_t::cur, storedUFO_t::disassembly, ERR_DROP, storedUFO_t::installation, capacities_t::max, MSG_TRANSFERFINISHED, MSO_CheckAddNewMessage(), installation_t::name, NT_TRANSFER_STARTED, RECOVERY_DELAY, storedUFO_t::status, SUFO_STORED, SUFO_TRANSFERED, and installation_t::ufoCapacity.
Referenced by US_TransferUFO_f().
| int US_UFOsInStorage | ( | const aircraft_t * | ufoTemplate, |
| const installation_t * | installation ) |
Returns the number of UFOs stored (on an installation or anywhere).
| [in] | ufoTemplate | aircraftTemplate of the ufo |
| [in] | installation | Pointer to the installation to count at |
Definition at line 180 of file cp_uforecovery.cpp.
References count, SUFO_STORED, and US_Foreach.
Referenced by PR_UpdateProductionList(), and RS_RequirementsMet().
|
static |
Definition at line 477 of file cp_uforecovery.cpp.
Referenced by UR_InitStartup(), and UR_Shutdown().