UFO: Alien Invasion
|
Header for installation management related stuff. More...
Go to the source code of this file.
Data Structures | |
struct | installationTemplate_s |
struct | installation_s |
A installation with all it's data. More... | |
Macros | |
#define | MAX_INSTALLATIONS_PER_BASE 3 |
#define | MAX_INSTALLATION_TEMPLATES 6 |
#define | MAX_INSTALLATION_DAMAGE 100 |
#define | MAX_INSTALLATION_BATTERIES 5 |
#define | INS_Foreach(var) LIST_Foreach(ccs.installations, installation_t, var) |
#define | INS_ForeachOfType(var, installationType) |
#define | INS_GetInstallationIDX(installation) ((installation)->idx) |
Typedefs | |
typedef struct installationTemplate_s | installationTemplate_t |
typedef struct installation_s | installation_t |
A installation with all it's data. More... | |
Enumerations | |
enum | installationStatus_t { INSTALLATION_NOT_USED, INSTALLATION_UNDER_CONSTRUCTION, INSTALLATION_WORKING } |
Possible installation states. More... | |
enum | installationType_t { INSTALLATION_RADAR, INSTALLATION_DEFENCE, INSTALLATION_UFOYARD, INSTALLATION_ORBIT, INSTALLATION_TYPE_MAX } |
Functions | |
installation_t * | INS_GetByIDX (int idx) |
Get installation by it's index. More... | |
installation_t * | INS_GetFirstUFOYard (bool free) |
returns the first installation with (free) ufostoring capacity More... | |
int | INS_GetCount (void) |
Get number of installations. More... | |
void | INS_ParseInstallations (const char *name, const char **text) |
Copies an entry from the installation description file into the list of installation templates. More... | |
const installationTemplate_t * | INS_GetInstallationTemplateByID (const char *id) |
Returns the installation Template for a given installation ID. More... | |
const installationTemplate_t * | INS_GetInstallationTemplateByType (installationType_t type) |
Returns the installation Template for a given installation type. More... | |
void | INS_LinkTechnologies (void) |
bool | INS_HasAny (installationStatus_t status=INSTALLATION_WORKING) |
Checks whether any installation is available. More... | |
bool | INS_HasType (installationType_t type, installationStatus_t status=INSTALLATION_WORKING) |
Checks whether the given installation type is available. More... | |
installationType_t | INS_GetType (const char *type) |
installation_t * | INS_Build (const installationTemplate_t *installationTemplate, const vec2_t pos, const char *name) |
Build a new installation. More... | |
void | INS_UpdateInstallationData (void) |
Check if some installation are build. More... | |
void | INS_DestroyInstallation (installation_t *installation) |
Destroys an installation. More... | |
installation_t * | INS_GetCurrentSelectedInstallation (void) |
Returns the current selected installation. More... | |
void | INS_SetCurrentSelectedInstallation (const installation_t *installation) |
Sets the currently selected installation. More... | |
void | INS_SelectInstallation (installation_t *installation) |
Select an installation when clicking on it on geoscape. More... | |
void | INS_InitStartup (void) |
Resets console commands. More... | |
void | INS_Shutdown (void) |
Closing operations for installations subsystem. More... | |
Variables | |
installation_t * | installationCurrent |
vec2_t | newInstallationPos |
Header for installation management related stuff.
Definition in file cp_installation.h.
#define INS_Foreach | ( | var | ) | LIST_Foreach(ccs.installations, installation_t, var) |
Definition at line 104 of file cp_installation.h.
Referenced by AII_UpdateInstallationDelay(), AIRFIGHT_CampaignRunBaseDefence(), BDEF_AutoSelectTarget(), CL_DisplayPopupInterceptUFO(), CL_PopupInterceptBaseClick_f(), CP_InterceptChooseInstallation(), GEO_Click(), GEO_DrawMarkers(), GEO_GetGeoscapeAngle(), INS_GetByIDX(), INS_GetCurrentSelectedInstallation(), INS_HasAny(), INS_SaveXML(), INS_SetCurrentSelectedInstallation(), INS_UpdateInstallationData(), RADAR_AddDetectedUFOToEveryRadar(), RADAR_CheckRadarSensored(), RADAR_DeactivateRadarOverlay(), RADAR_NotifyUFORemoved(), RADAR_UpdateStaticRadarCoverage(), UFO_CampaignCheckEvents(), UFO_UpdateAlienInterestForAllBasesAndInstallations(), and UR_DialogInitStore_f().
#define INS_ForeachOfType | ( | var, | |
installationType | |||
) |
Definition at line 105 of file cp_installation.h.
Referenced by CP_CheckTriggerEvent(), INS_GetFirstUFOYard(), INS_HasType(), and US_FillUFOTransfer_f().
#define INS_GetInstallationIDX | ( | installation | ) | ((installation)->idx) |
Definition at line 109 of file cp_installation.h.
#define MAX_INSTALLATION_BATTERIES 5 |
Definition at line 31 of file cp_installation.h.
#define MAX_INSTALLATION_DAMAGE 100 |
Definition at line 30 of file cp_installation.h.
#define MAX_INSTALLATION_TEMPLATES 6 |
Definition at line 28 of file cp_installation.h.
Referenced by INS_ParseInstallations().
#define MAX_INSTALLATIONS_PER_BASE 3 |
Definition at line 27 of file cp_installation.h.
Referenced by B_GetInstallationLimit(), and TEST_F().
typedef struct installation_s installation_t |
A installation with all it's data.
typedef struct installationTemplate_s installationTemplate_t |
enum installationStatus_t |
Possible installation states.
Enumerator | |
---|---|
INSTALLATION_NOT_USED |
installation is not set yet |
INSTALLATION_UNDER_CONSTRUCTION |
installation is under construction |
INSTALLATION_WORKING |
nothing special, it's working |
Definition at line 37 of file cp_installation.h.
enum installationType_t |
Enumerator | |
---|---|
INSTALLATION_RADAR | |
INSTALLATION_DEFENCE | |
INSTALLATION_UFOYARD | |
INSTALLATION_ORBIT | |
INSTALLATION_TYPE_MAX |
Definition at line 43 of file cp_installation.h.
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 145 of file cp_installation.cpp.
References installation_s::alienInterest, installation_s::buildStart, ccs_s::campaignStats, ccs, ccs_s::date, date_s::day, installation_s::idx, INSTALLATION_UNDER_CONSTRUCTION, installation_s::installationDamage, ccs_s::installations, stats_s::installationsBuilt, installation_s::installationStatus, installation_s::installationTemplate, LIST_Add(), installationTemplate_s::maxDamage, installation_s::name, OBJZERO, installation_s::pos, Q_strncpyz(), installation_s::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 176 of file cp_installation.cpp.
References _, ccs, cgi, Com_sprintf(), cp_messageBuffer, CP_MissionNotifyInstallationDestroyed(), cgame_import_s::Cvar_Set(), INS_GetCount(), ccs_s::installations, capacities_s::max, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), installation_s::name, NT_INSTALLATION_DESTROY, RADAR_UpdateInstallationRadarCoverage(), installation_s::ufoCapacity, and US_RemoveUFOsExceedingCapacity().
Referenced by CP_InterceptMissionLeave(), and INS_DestroyInstallation_f().
installation_t* INS_GetByIDX | ( | int | idx | ) |
Get installation by it's index.
[in] | idx | Instalation's index |
nullptr
if not found. Definition at line 93 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 39 of file cp_installation.cpp.
References ccs, cgi, and ccs_s::installations.
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 199 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 313 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 108 of file cp_installation.cpp.
References ccs, installationTemplate_s::id, mission_s::idx, ccs_s::installationTemplates, ccs_s::numInstallationTemplates, 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 126 of file cp_installation.cpp.
References ccs, mission_s::idx, ccs_s::installationTemplates, ccs_s::numInstallationTemplates, and installationTemplate_s::type.
Referenced by CP_SpawnUFOCarrier_f(), CreateInstallation(), INS_LoadXML(), and INS_SetInstallationTitle().
installationType_t INS_GetType | ( | const char * | type | ) |
Definition at line 44 of file cp_installation.cpp.
References cgi, INSTALLATION_DEFENCE, INSTALLATION_ORBIT, INSTALLATION_RADAR, INSTALLATION_UFOYARD, and Q_streq.
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 63 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 78 of file cp_installation.cpp.
References INS_ForeachOfType, and INSTALLATION_NOT_USED.
Referenced by CP_AttackUFOCarrier_f(), CP_CheckTriggerEvent(), CP_UFOCarrierMissionUpdate(), INS_FillTypes_f(), and INS_SelectType_f().
Resets console commands.
Definition at line 335 of file cp_installation.cpp.
References cgi.
Referenced by CP_InitStartup().
Definition at line 450 of file cp_installation.cpp.
References ccs, i, installationTemplate_s::id, ccs_s::installationTemplates, ccs_s::numInstallationTemplates, RS_GetTechByProvided(), and installationTemplate_s::tech.
Referenced by CP_ParseCampaignData().
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 391 of file cp_installation.cpp.
References ccs, cgi, cgame_import_s::Com_EParse(), Com_Parse(), cp_campaignPool, DEBUG_CLIENT, i, installationTemplate_s::id, INS_GetType(), INSTALLATION_RADAR, ccs_s::installationTemplates, MAX_INSTALLATION_TEMPLATES, installationTemplate_s::name, ccs_s::numInstallationTemplates, OBJZERO, cgame_import_s::PoolStrDup(), Q_streq, and installationTemplate_s::type.
Referenced by CP_ParseScriptFirst().
void INS_SelectInstallation | ( | installation_t * | installation | ) |
Select an installation when clicking on it on geoscape.
[in] | installation | The installation to select |
nullptr
Definition at line 56 of file cp_installation_callbacks.cpp.
References B_SetCurrentSelectedBase(), installation_s::buildStart, installationTemplate_s::buildTime, ccs, cgi, cgame_import_s::Cvar_Set(), ccs_s::date, date_s::day, DEBUG_CLIENT, installation_s::idx, INS_SetCurrentSelectedInstallation(), INSTALLATION_DEFENCE, INSTALLATION_UFOYARD, INSTALLATION_WORKING, installation_s::installationStatus, installation_s::installationTemplate, MA_NONE, ccs_s::mapAction, ngettext, and installationTemplate_s::type.
Referenced by INS_SelectInstallation_f().
void INS_SetCurrentSelectedInstallation | ( | const installation_t * | installation | ) |
Sets the currently selected installation.
installation | Pointer to the installation to select |
Definition at line 214 of file cp_installation.cpp.
References cgi, cgame_import_s::Cvar_Set(), installationTemplate_s::id, INS_Foreach, installation_s::installationTemplate, and installation_s::name.
Referenced by B_SetCurrentSelectedBase(), and INS_SelectInstallation().
Closing operations for installations subsystem.
Definition at line 343 of file cp_installation.cpp.
References ccs, cgi, and ccs_s::installations.
Referenced by CP_Shutdown().
Check if some installation are build.
Definition at line 353 of file cp_installation.cpp.
References _, ccs, Com_sprintf(), cp_messageBuffer, ccs_s::date, date_s::day, INS_FinishInstallation(), INS_Foreach, INSTALLATION_UNDER_CONSTRUCTION, lengthof, MSG_CONSTRUCTION, MSO_CheckAddNewMessage(), and NT_INSTALLATION_BUILDFINISH.
Referenced by CP_CampaignRun(), and CreateInstallation().
installation_t* installationCurrent |
Currently displayed/accessed base.
vec2_t newInstallationPos |
Coordinates to place the new installation at (long, lat)