UFO: Alien Invasion
Loading...
Searching...
No Matches
save_base.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#define SAVE_BASES_BASES "bases"
28
29#define SAVE_BASES_BASE "base"
30#define SAVE_BASES_IDX "idx"
31#define SAVE_BASES_NAME "name"
32#define SAVE_BASES_POS "pos"
33#define SAVE_BASES_BASESTATUS "baseStatus"
34#define SAVE_BASES_ALIENINTEREST "alienInterest"
35
36#define SAVE_BASES_BUILDINGSPACE "buildingSpace"
37#define SAVE_BASES_BUILDING "building"
38#define SAVE_BASES_X "x"
39#define SAVE_BASES_Y "y"
40#define SAVE_BASES_BUILDINGINDEX "buildingIDX"
41#define SAVE_BASES_BLOCKED "blocked"
42
43#define SAVE_BASES_BUILDINGS "buildings"
44#define SAVE_BASES_BUILDINGTYPE "buildingType"
45#define SAVE_BASES_BUILDING_PLACE "buildingPlace"
46#define SAVE_BASES_BUILDINGSTATUS "buildingStatus"
47#define SAVE_BASES_BUILDINGTIMESTART "buildingTimeStart"
48#define SAVE_BASES_BUILDINGBUILDTIME "buildingBuildTime"
49#define SAVE_BASES_BUILDINGLEVEL "buildingLevel"
50
51#define SAVE_BASES_BATTERIES "batteries"
52#define SAVE_BASES_LASERS "lasers"
53#define SAVE_BASES_WEAPON "weapon"
54#define SAVE_BASES_AUTOFIRE "autoFire"
55#define SAVE_BASES_TARGET "target"
56
57#define SAVE_BASES_STORAGE "storage"
58#define SAVE_BASES_ITEM "item"
59#define SAVE_BASES_ODS_ID "id"
60#define SAVE_BASES_NUM "num"
61#define SAVE_BASES_NUMLOOSE "numLoose"
62
63#define SAVE_BASES_RADARRANGE "radarRange"
64#define SAVE_BASES_TRACKINGRANGE "trackingRange"
65
66#define SAVE_BASES_ALIENCONTAINMENT "alienContainment"
67
68#define SAVE_BASESTATUS_NAMESPACE "savebaseStatus"
69#define SAVE_BUILDINGSTATUS_NAMESPACE "savebuildingStatus"
73 /* other base statuses (notused, destroyed) should not appear in savegames */
78
79 {nullptr, -1}
80};
81
82/*
83DTD:
84
85<!ELEMENT bases base+>
86<!ELEMENT base pos buildingSpace buildings batteries lasers alienContainment?>
87<!ATTLIST base
88 idx CDATA #REQUIRED
89 name CDATA #IMPLIED
90 baseStatus (underattack,
91 working) #REQUIRED
92 alienInterest CDATA '0'
93 currentAircraftIDX CDATA #IMPLIED
94 radarRange CDATA '0'
95 trackingRange CDATA '0'
96>
97
98<!ELEMENT pos EMPTY>
99<!ATTLIST pos
100 x CDATA '0.0'
101 y CDATA '0.0'
102 z CDATA '0.0'
103>
104
105<!ELEMENT buildingSpace building+>
106<!ELEMENT building EMPTY>
107<!ATTLIST building
108 x CDATA '0'
109 y CDATA '0'
110 buildingIDX CDATA #IMPLIED
111 blocked CDATA 'false'
112>
113
114<!ELEMENT buildings building*>
115<!ELEMENT building pos>
116<!ATTLIST building
117 buildingType CDATA #REQUIRED
118 buildingPlace CDATA
119 buildingStatus (
120
121
122 )
123 buildingTimeStart CDATA '0'
124 buildingBuildTime CDATA '0'
125 buildingLevel CDATA '0'
126>
127
128<!ELEMENT batteries weapon*>
129<!ELEMENT lasers weapon*>
130<!ELEMENT weapon EMPTY>
131<!ATTLIST weapon
132 autoFire CDATA 'true'
133 target CDATA #IMPLIED
134 ...
135>
136**Note: more ATTLIST of weapon is defined in save_fightequip.h
137
138<!ELEMENT storage item*>
139
140<!ELEMENT item EMPTY>
141<!ATTLIST item
142 id CDATA #REQUIRED
143 num CDATA '0'
144 numLoose CDATA '0'
145>
146*/
@ BASE_UNDER_ATTACK
Definition cp_base.h:63
@ BASE_WORKING
Definition cp_base.h:64
@ B_STATUS_CONSTRUCTION_FINISHED
Definition cp_building.h:34
@ B_STATUS_UNDER_CONSTRUCTION
Definition cp_building.h:33
@ B_STATUS_WORKING
Definition cp_building.h:36
@ B_STATUS_DOWN
Definition cp_building.h:37
static const constListEntry_t saveBaseConstants[]
Definition save_base.h:70
#define SAVE_BASESTATUS_NAMESPACE
Definition save_base.h:68
#define SAVE_BUILDINGSTATUS_NAMESPACE
Definition save_base.h:69
list of script aliases to register
Definition scripts.h:231