UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
cp_uforecovery.h
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
*/
24
25
#pragma once
26
27
#include "
../../DateTime.h
"
28
29
/* time the recovery takes in days */
30
#define RECOVERY_DELAY 2.0f
31
36
typedef
enum
{
37
SUFO_RECOVERED
,
38
SUFO_STORED
,
39
SUFO_TRANSFERED
,
40
41
MAX_SUFO_STATUS
42
}
storedUFOStatus_t
;
43
45
typedef
struct
storedUFO_s {
46
int
idx
;
47
char
id
[
MAX_VAR
];
48
struct
components_s*
comp
;
49
const
aircraft_t
*
ufoTemplate
;
50
51
storedUFOStatus_t
status
;
52
DateTime
arrive
;
53
54
float
condition
;
55
56
/* installation UFO is stored */
57
installation_t
*
installation
;
58
59
/* link to disassembly item */
60
production_t
*
disassembly
;
61
}
storedUFO_t
;
62
63
void
UR_ProcessActive
(
void
);
64
65
#define US_Foreach(var) LIST_Foreach(ccs.storedUFOs, storedUFO_t, var)
66
67
storedUFO_t
*
US_StoreUFO
(
const
aircraft_t
* ufoTemplate,
installation_t
* installation,
DateTime
& date,
float
condition);
68
storedUFO_t
*
US_GetStoredUFOByIDX
(
const
int
idx);
69
storedUFO_t
*
US_GetClosestStoredUFO
(
const
aircraft_t
* ufoTemplate,
const
base_t
* base);
70
void
US_RemoveStoredUFO
(
storedUFO_t
* ufo);
71
int
US_UFOsInStorage
(
const
aircraft_t
* ufoTemplate,
const
installation_t
* installation);
72
int
US_StoredUFOCount
(
void
);
73
void
US_RemoveUFOsExceedingCapacity
(
installation_t
* installation);
74
bool
US_TransferUFO
(
storedUFO_t
* ufo,
installation_t
* ufoyard);
75
79
#define US_UFOStored() (US_GetNext(nullptr) != nullptr)
80
81
void
UR_InitStartup
(
void
);
82
void
UR_Shutdown
(
void
);
DateTime.h
DateTime class definition.
DateTime
Class describing a point of time.
Definition
DateTime.h:31
US_StoredUFOCount
int US_StoredUFOCount(void)
Returns the number of storedUFOs.
Definition
cp_uforecovery.cpp:288
US_GetStoredUFOByIDX
storedUFO_t * US_GetStoredUFOByIDX(const int idx)
Returns a stored ufo.
Definition
cp_uforecovery.cpp:83
UR_Shutdown
void UR_Shutdown(void)
Closing actions for ufostoring-subsystem.
Definition
cp_uforecovery.cpp:498
storedUFOStatus_t
storedUFOStatus_t
different statuses for a stored UFO
Definition
cp_uforecovery.h:36
SUFO_STORED
@ SUFO_STORED
Definition
cp_uforecovery.h:38
SUFO_RECOVERED
@ SUFO_RECOVERED
Definition
cp_uforecovery.h:37
SUFO_TRANSFERED
@ SUFO_TRANSFERED
Definition
cp_uforecovery.h:39
MAX_SUFO_STATUS
@ MAX_SUFO_STATUS
Definition
cp_uforecovery.h:41
US_GetClosestStoredUFO
storedUFO_t * US_GetClosestStoredUFO(const aircraft_t *ufoTemplate, const base_t *base)
get the closest stored ufo (of a type) from a base
Definition
cp_uforecovery.cpp:261
US_RemoveStoredUFO
void US_RemoveStoredUFO(storedUFO_t *ufo)
Removes an UFO from the storage.
Definition
cp_uforecovery.cpp:148
US_StoreUFO
storedUFO_t * US_StoreUFO(const aircraft_t *ufoTemplate, installation_t *installation, DateTime &date, float condition)
Adds an UFO to the storage.
Definition
cp_uforecovery.cpp:100
US_RemoveUFOsExceedingCapacity
void US_RemoveUFOsExceedingCapacity(installation_t *installation)
Removes ufos which are over the storing capacity.
Definition
cp_uforecovery.cpp:202
UR_InitStartup
void UR_InitStartup(void)
Init actions for ufostoring-subsystem.
Definition
cp_uforecovery.cpp:489
US_UFOsInStorage
int US_UFOsInStorage(const aircraft_t *ufoTemplate, const installation_t *installation)
Returns the number of UFOs stored (on an installation or anywhere).
Definition
cp_uforecovery.cpp:180
US_TransferUFO
bool US_TransferUFO(storedUFO_t *ufo, installation_t *ufoyard)
Start transferring of a stored UFO.
Definition
cp_uforecovery.cpp:225
UR_ProcessActive
void UR_ProcessActive(void)
Function to process active recoveries.
Definition
cp_uforecovery.cpp:47
MAX_VAR
#define MAX_VAR
Definition
shared.h:36
aircraft_t
An aircraft with all it's data.
Definition
cp_aircraft.h:115
base_t
A base with all it's data.
Definition
cp_base.h:84
installation_t
A installation with all it's data.
Definition
cp_installation.h:73
production_t
Holds all information for the production of one item-type.
Definition
cp_produce.h:60
storedUFO_t
Structure for stored UFOs.
Definition
cp_uforecovery.h:45
storedUFO_t::disassembly
production_t * disassembly
Definition
cp_uforecovery.h:60
storedUFO_t::comp
struct components_s * comp
Definition
cp_uforecovery.h:48
storedUFO_t::arrive
DateTime arrive
Definition
cp_uforecovery.h:52
storedUFO_t::ufoTemplate
const aircraft_t * ufoTemplate
Definition
cp_uforecovery.h:49
storedUFO_t::status
storedUFOStatus_t status
Definition
cp_uforecovery.h:51
storedUFO_t::condition
float condition
Definition
cp_uforecovery.h:54
storedUFO_t::installation
installation_t * installation
Definition
cp_uforecovery.h:57
storedUFO_t::idx
int idx
Definition
cp_uforecovery.h:46
src
client
cgame
campaign
cp_uforecovery.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0