UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_uforecovery.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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
43
45typedef struct storedUFO_s {
46 int idx;
47 char id[MAX_VAR];
48 struct components_s* comp;
50
53
54 float condition;
55
56 /* installation UFO is stored */
58
59 /* link to disassembly item */
62
63void UR_ProcessActive(void);
64
65#define US_Foreach(var) LIST_Foreach(ccs.storedUFOs, storedUFO_t, var)
66
67storedUFO_t* US_StoreUFO(const aircraft_t* ufoTemplate, installation_t* installation, DateTime& date, float condition);
68storedUFO_t* US_GetStoredUFOByIDX(const int idx);
69storedUFO_t* US_GetClosestStoredUFO(const aircraft_t* ufoTemplate, const base_t* base);
71int US_UFOsInStorage(const aircraft_t* ufoTemplate, const installation_t* installation);
72int US_StoredUFOCount(void);
74bool US_TransferUFO(storedUFO_t* ufo, installation_t* ufoyard);
75
79#define US_UFOStored() (US_GetNext(nullptr) != nullptr)
80
81void UR_InitStartup(void);
82void UR_Shutdown(void);
DateTime class definition.
Class describing a point of time.
Definition DateTime.h:31
int US_StoredUFOCount(void)
Returns the number of storedUFOs.
storedUFO_t * US_GetStoredUFOByIDX(const int idx)
Returns a stored ufo.
void UR_Shutdown(void)
Closing actions for ufostoring-subsystem.
storedUFOStatus_t
different statuses for a stored UFO
@ SUFO_STORED
@ SUFO_RECOVERED
@ SUFO_TRANSFERED
@ MAX_SUFO_STATUS
storedUFO_t * US_GetClosestStoredUFO(const aircraft_t *ufoTemplate, const base_t *base)
get the closest stored ufo (of a type) from a base
void US_RemoveStoredUFO(storedUFO_t *ufo)
Removes an UFO from the storage.
storedUFO_t * US_StoreUFO(const aircraft_t *ufoTemplate, installation_t *installation, DateTime &date, float condition)
Adds an UFO to the storage.
void US_RemoveUFOsExceedingCapacity(installation_t *installation)
Removes ufos which are over the storing capacity.
void UR_InitStartup(void)
Init actions for ufostoring-subsystem.
int US_UFOsInStorage(const aircraft_t *ufoTemplate, const installation_t *installation)
Returns the number of UFOs stored (on an installation or anywhere).
bool US_TransferUFO(storedUFO_t *ufo, installation_t *ufoyard)
Start transferring of a stored UFO.
void UR_ProcessActive(void)
Function to process active recoveries.
#define MAX_VAR
Definition shared.h:36
An aircraft with all it's data.
A base with all it's data.
Definition cp_base.h:84
A installation with all it's data.
Holds all information for the production of one item-type.
Definition cp_produce.h:60
Structure for stored UFOs.
production_t * disassembly
struct components_s * comp
DateTime arrive
const aircraft_t * ufoTemplate
storedUFOStatus_t status
installation_t * installation