|
UFO: Alien Invasion
|
Handles everything that is located in or accessed through an installation. More...
#include "../../DateTime.h"#include "../../cl_shared.h"#include "../../../shared/parse.h"#include "cp_campaign.h"#include "cp_mapfightequip.h"#include "cp_aircraft.h"#include "cp_missions.h"#include "cp_installation.h"#include "save/save_installation.h"
Go to the source code of this file.
Functions | |
| int | INS_GetCount (void) |
| Get number of installations. | |
| installationType_t | INS_GetType (const char *type) |
| bool | INS_HasAny (installationStatus_t status) |
| Checks whether any installation is available. | |
| bool | INS_HasType (installationType_t type, installationStatus_t status) |
| Checks whether the given installation type is available. | |
| installation_t * | INS_GetByIDX (int idx) |
| Get installation by it's index. | |
| const installationTemplate_t * | INS_GetInstallationTemplateByID (const char *id) |
| Returns the installation Template for a given installation ID. | |
| const installationTemplate_t * | INS_GetInstallationTemplateByType (installationType_t type) |
| Returns the installation Template for a given installation type. | |
| installation_t * | INS_Build (const installationTemplate_t *installationTemplate, const vec2_t pos, const char *name) |
| Build a new installation. | |
| void | INS_DestroyInstallation (installation_t *installation) |
| Destroys an installation. | |
| installation_t * | INS_GetCurrentSelectedInstallation (void) |
| Returns the current selected installation. | |
| void | INS_SetCurrentSelectedInstallation (const installation_t *installation) |
| Sets the currently selected installation. | |
| static void | INS_FinishInstallation (installation_t *installation) |
| Finishes an installation. | |
| installation_t * | INS_GetFirstUFOYard (bool free) |
| returns the first installation with (free) ufostoring capacity | |
| void | INS_InitStartup (void) |
| Resets console commands. | |
| void | INS_Shutdown (void) |
| Closing operations for installations subsystem. | |
| void | INS_UpdateInstallationData (void) |
| Check if some installation are build. | |
| void | INS_ParseInstallations (const char *name, const char **text) |
| Copies an entry from the installation description file into the list of installation templates. | |
| void | INS_LinkTechnologies (void) |
| bool | INS_SaveXML (xmlNode_t *p) |
| Save callback for savegames in xml. | |
| bool | INS_LoadXML (xmlNode_t *p) |
| Load callback for savegames. | |
Variables | |
| static const cmdList_t | debugInstallationCmds [] |
| static const value_t | installation_vals [] |
Handles everything that is located in or accessed through an installation.
Definition in file cp_installation.cpp.
| installation_t * INS_Build | ( | const installationTemplate_t * | installationTemplate, |
| const vec2_t | pos, | ||
| const char * | name ) |
Build a new installation.
| [in] | installationTemplate | Template pointer |
| [in] | pos | Position on Globe to build at |
| [in] | name | The name of the installation - might already be in utf-8 |
Definition at line 146 of file cp_installation.cpp.
References installation_t::alienInterest, installation_t::buildStart, ccs, installation_t::idx, INSTALLATION_UNDER_CONSTRUCTION, installation_t::installationDamage, installation_t::installationStatus, installation_t::installationTemplate, LIST_Add(), installationTemplate_t::maxDamage, installation_t::name, name, OBJZERO, installation_t::pos, Q_strncpyz(), installation_t::radar, RADAR_Initialise(), and Vector2Copy.
Referenced by CP_SpawnUFOCarrier_f(), CreateInstallation(), and INS_BuildInstallation_f().
| void INS_DestroyInstallation | ( | installation_t * | installation | ) |
Destroys an installation.
| [in,out] | installation | Pointer to the installation to be destroyed |
Definition at line 177 of file cp_installation.cpp.
References _, ccs, cgi, Com_sprintf(), cp_messageBuffer, CP_MissionNotifyInstallationDestroyed(), INS_GetCount(), capacities_t::max, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), installation_t::name, NT_INSTALLATION_DESTROY, RADAR_UpdateInstallationRadarCoverage(), installation_t::ufoCapacity, and US_RemoveUFOsExceedingCapacity().
Referenced by CP_InterceptMissionLeave(), and INS_DestroyInstallation_f().
|
static |
Finishes an installation.
| [in,out] | installation | Pointer to the installation to be finished |
Definition at line 235 of file cp_installation.cpp.
References BDEF_InitialiseInstallationSlots(), cgi, DEBUG_CLIENT, ERR_DROP, INSTALLATION_UNDER_CONSTRUCTION, INSTALLATION_WORKING, installation_t::installationStatus, installation_t::installationTemplate, capacities_t::max, installationTemplate_t::maxBatteries, installationTemplate_t::maxUFOsStored, installation_t::numBatteries, RADAR_UpdateInstallationRadarCoverage(), installationTemplate_t::radarRange, installationTemplate_t::trackingRange, and installation_t::ufoCapacity.
Referenced by INS_UpdateInstallationData().
| installation_t * INS_GetByIDX | ( | int | idx | ) |
Get installation by it's index.
| [in] | idx | Instalation's index |
nullptr if not found. Definition at line 94 of file cp_installation.cpp.
References INS_Foreach.
Referenced by INS_DestroyInstallation_f(), INS_FillUFOYardData_f(), INS_SelectInstallation_f(), MIS_LoadXML(), UR_DialogStartStore_f(), US_FillUFOTransferUFOs_f(), US_LoadXML(), and US_TransferUFO_f().
Get number of installations.
Definition at line 40 of file cp_installation.cpp.
Referenced by GEO_GetGeoscapeAngle(), INS_BuildInstallation_f(), INS_DestroyInstallation(), INS_FillTypes_f(), INS_InitCallbacks(), INS_LoadXML(), and INS_SelectType_f().
| installation_t * INS_GetCurrentSelectedInstallation | ( | void | ) |
Returns the current selected installation.
Definition at line 200 of file cp_installation.cpp.
References INS_Foreach.
Referenced by BDEF_AddItem_f(), BDEF_BaseDefenceMenuUpdate_f(), BDEF_ChangeAutoFire(), BDEF_RemoveItem_f(), BDEF_SelectItem_f(), INS_ChangeInstallationName_f(), INS_DestroyInstallation_f(), and INS_FillUFOYardData_f().
| installation_t * INS_GetFirstUFOYard | ( | bool | free | ) |
returns the first installation with (free) ufostoring capacity
| [in] | free | On true it gives the first UFO Yard with free space |
Definition at line 314 of file cp_installation.cpp.
References INS_ForeachOfType, and INSTALLATION_UFOYARD.
Referenced by INS_FillUFOYardData_f().
| const installationTemplate_t * INS_GetInstallationTemplateByID | ( | const char * | id | ) |
Returns the installation Template for a given installation ID.
| [in] | id | ID of the installation template to find. |
nullptr if not found. Definition at line 109 of file cp_installation.cpp.
References ccs, installationTemplate_t::id, and Q_streq.
Referenced by INS_BuildInstallation_f(), and INS_SelectType_f().
| const installationTemplate_t * INS_GetInstallationTemplateByType | ( | installationType_t | type | ) |
Returns the installation Template for a given installation type.
| [in] | type | Type of the installation template to find. |
nullptr if not found. Definition at line 127 of file cp_installation.cpp.
References ccs, installationTemplate_t::type, and type.
Referenced by CP_SpawnUFOCarrier_f(), CreateInstallation(), INS_LoadXML(), and INS_SetInstallationTitle().
| installationType_t INS_GetType | ( | const char * | type | ) |
Definition at line 45 of file cp_installation.cpp.
References cgi, INSTALLATION_DEFENCE, INSTALLATION_ORBIT, INSTALLATION_RADAR, INSTALLATION_UFOYARD, Q_streq, and type.
Referenced by CP_CheckTriggerEvent(), INS_LoadXML(), and INS_ParseInstallations().
| bool INS_HasAny | ( | installationStatus_t | status | ) |
Checks whether any installation is available.
| [in] | status | Status of installation to search for |
Definition at line 64 of file cp_installation.cpp.
References INS_Foreach, and INSTALLATION_NOT_USED.
Referenced by CP_InterceptMissionSet().
| bool INS_HasType | ( | installationType_t | type, |
| installationStatus_t | status ) |
Checks whether the given installation type is available.
| [in] | type | Installation type to search for |
| [in] | status | Status of installation to search for |
Definition at line 79 of file cp_installation.cpp.
References INS_ForeachOfType, INSTALLATION_NOT_USED, and type.
Referenced by CP_AttackUFOCarrier_f(), CP_CheckTriggerEvent(), CP_UFOCarrierMissionUpdate(), INS_FillTypes_f(), and INS_SelectType_f().
Resets console commands.
Definition at line 336 of file cp_installation.cpp.
References cgi, and debugInstallationCmds.
Referenced by CP_InitStartup().
Definition at line 451 of file cp_installation.cpp.
References ccs, i, installationTemplate_t::id, RS_GetTechByProvided(), and installationTemplate_t::tech.
Referenced by CP_ParseCampaignData().
| bool INS_LoadXML | ( | xmlNode_t * | p | ) |
Load callback for savegames.
| [in] | p | XML Node structure, where we get the information from |
Definition at line 499 of file cp_installation.cpp.
References installation_t::alienInterest, B_LoadBaseSlotsXML(), installation_t::batteries, BDEF_InitialiseInstallationSlots(), installation_t::buildStart, ccs, cgi, capacities_t::cur, installation_t::idx, INS_GetCount(), INS_GetInstallationTemplateByType(), INS_GetType(), INSTALLATION_WORKING, installation_t::installationDamage, installation_t::installationStatus, installation_t::installationTemplate, LIST_Add(), capacities_t::max, installationTemplate_t::maxBatteries, installationTemplate_t::maxUFOsStored, installation_t::name, installation_t::numBatteries, OBJZERO, installation_t::pos, Q_strncpyz(), installation_t::radar, RADAR_Initialise(), RADAR_InitialiseUFOs(), RADAR_UpdateInstallationRadarCoverage(), installationTemplate_t::radarRange, SAVE_INSTALLATION_ALIENINTEREST, SAVE_INSTALLATION_BATTERIES, SAVE_INSTALLATION_BUILDSTART, SAVE_INSTALLATION_DAMAGE, SAVE_INSTALLATION_IDX, SAVE_INSTALLATION_INSTALLATION, SAVE_INSTALLATION_INSTALLATIONS, SAVE_INSTALLATION_NAME, SAVE_INSTALLATION_NUM, SAVE_INSTALLATION_POS, SAVE_INSTALLATION_STATUS, SAVE_INSTALLATION_TEMPLATEID, SAVE_INSTALLATIONSTATUS_NAMESPACE, saveInstallationConstants, installationTemplate_t::trackingRange, type, installation_t::ufoCapacity, and xmlNode_t.
Referenced by SAV_Init().
| void INS_ParseInstallations | ( | const char * | name, |
| const char ** | text ) |
Copies an entry from the installation description file into the list of installation templates.
| [in] | name | Unique test-id of a installationTemplate_t. |
| [in] | text | the rest of the script file that is tokenized here |
Definition at line 392 of file cp_installation.cpp.
References ccs, cgi, Com_Parse(), cp_campaignPool, DEBUG_CLIENT, i, installationTemplate_t::id, INS_GetType(), INSTALLATION_RADAR, installation_vals, MAX_INSTALLATION_TEMPLATES, name, OBJZERO, Q_streq, and installationTemplate_t::type.
Referenced by CP_ParseScriptFirst().
| bool INS_SaveXML | ( | xmlNode_t * | p | ) |
Save callback for savegames in xml.
| [out] | p | XML Node structure, where we write the information to |
Definition at line 467 of file cp_installation.cpp.
References B_SaveBaseSlotsXML(), cgi, INS_Foreach, SAVE_INSTALLATION_ALIENINTEREST, SAVE_INSTALLATION_BATTERIES, SAVE_INSTALLATION_BUILDSTART, SAVE_INSTALLATION_DAMAGE, SAVE_INSTALLATION_IDX, SAVE_INSTALLATION_INSTALLATION, SAVE_INSTALLATION_INSTALLATIONS, SAVE_INSTALLATION_NAME, SAVE_INSTALLATION_NUM, SAVE_INSTALLATION_POS, SAVE_INSTALLATION_STATUS, SAVE_INSTALLATION_TEMPLATEID, SAVE_INSTALLATIONSTATUS_NAMESPACE, saveInstallationConstants, and xmlNode_t.
Referenced by SAV_Init().
| void INS_SetCurrentSelectedInstallation | ( | const installation_t * | installation | ) |
Sets the currently selected installation.
| installation | Pointer to the installation to select |
Definition at line 215 of file cp_installation.cpp.
References cgi, installationTemplate_t::id, INS_Foreach, installation_t::installationTemplate, installation_t::name, and installation_t::selected.
Referenced by B_SetCurrentSelectedBase(), and INS_SelectInstallation().
Closing operations for installations subsystem.
Definition at line 344 of file cp_installation.cpp.
References ccs, cgi, and debugInstallationCmds.
Referenced by CP_Shutdown().
Check if some installation are build.
Definition at line 354 of file cp_installation.cpp.
References _, ccs, Com_sprintf(), cp_messageBuffer, INS_FinishInstallation(), INS_Foreach, INSTALLATION_UNDER_CONSTRUCTION, lengthof, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), and NT_INSTALLATION_BUILDFINISH.
Referenced by CP_CampaignRun(), and CreateInstallation().
|
static |
Definition at line 326 of file cp_installation.cpp.
Referenced by INS_InitStartup(), and INS_Shutdown().
|
static |
Definition at line 368 of file cp_installation.cpp.
Referenced by INS_ParseInstallations().