00001 00006 /* 00007 Copyright (C) 2002-2010 UFO: Alien Invasion. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00017 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 00024 */ 00025 00026 #ifndef CLIENT_CL_UFORECOVERY_H 00027 #define CLIENT_CL_UFORECOVERY_H 00028 00029 /* time the recovery takes in days */ 00030 #define RECOVERY_DELAY 2.0f 00031 00036 typedef enum { 00037 SUFO_RECOVERED, 00038 SUFO_STORED, 00039 SUFO_TRANSFERED, 00041 MAX_SUFO_STATUS 00042 } storedUFOStatus_t; 00043 00045 typedef struct storedUFO_s { 00046 int idx; 00047 char id[MAX_VAR]; 00048 components_t *comp; 00049 const aircraft_t *ufoTemplate; 00050 00051 storedUFOStatus_t status; 00052 /* arrival date (recovery/transfer) */ 00053 date_t arrive; 00054 00055 float condition; 00056 00057 /* installation UFO is stored */ 00058 installation_t *installation; 00059 00060 /* link to disassembly item */ 00061 production_t *disassembly; 00062 } storedUFO_t; 00063 00064 void UR_ProcessActive(void); 00065 00066 storedUFO_t *US_StoreUFO(const aircraft_t *ufoTemplate, installation_t *installation, date_t date, float condition); 00067 storedUFO_t* US_GetNext(storedUFO_t *lastUFO); 00068 storedUFO_t *US_GetStoredUFOByIDX(const int idx); 00069 storedUFO_t *US_GetClosestStoredUFO(const aircraft_t *ufoTemplate, const base_t *base); 00070 void US_RemoveStoredUFO(storedUFO_t *ufo); 00071 int US_UFOsInStorage(const aircraft_t *ufoTemplate, const installation_t *installation); 00072 int US_StoredUFOCount(void); 00073 void US_RemoveUFOsExceedingCapacity(installation_t *installation); 00074 00078 #define US_UFOStored() (US_GetNext(NULL) != NULL) 00079 00080 00081 #endif