forked from triplea-game/triplea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.dtd
297 lines (263 loc) · 7.14 KB
/
game.dtd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<?xml version="1.0" encoding="ISO-8859-1"?>
<!ELEMENT game (info, loader, triplea?, diceSides?, map, resourceList?, playerList, unitList?, relationshipTypes?, territoryEffectList?, gamePlay, production?, technology?, attachmentList? , initialize?, propertyList?)>
<!-- version must be in the form xx.xx or xx.xx.xx where xx is a positive integer -->
<!ELEMENT info EMPTY>
<!ATTLIST info
name CDATA #REQUIRED
version CDATA #REQUIRED
>
<!-- javaClass must implement the IGameLoader interface -->
<!ELEMENT loader EMPTY>
<!ATTLIST loader
javaClass CDATA #REQUIRED
>
<!-- minimum version of triplea required to play this map xml -->
<!ELEMENT triplea EMPTY>
<!ATTLIST triplea
minimumVersion CDATA #REQUIRED
>
<!-- Number of sides on dice -->
<!ELEMENT diceSides EMPTY>
<!ATTLIST diceSides
value CDATA #REQUIRED
>
<!ELEMENT map ((grid | territory)+ , connection*, remove-connection*)>
<!ELEMENT grid EMPTY>
<!ATTLIST grid
name CDATA #REQUIRED
type (square | points-and-lines) #REQUIRED
x CDATA #REQUIRED
y CDATA #REQUIRED
horizontal-connections (explicit | implicit) 'explicit'
vertical-connections (explicit | implicit) 'explicit'
diagonal-connections (explicit | implicit) 'explicit'
>
<!ELEMENT territory EMPTY>
<!ATTLIST territory
name CDATA #REQUIRED
water (true | false) "false"
>
<!-- connections are two way -->
<!ELEMENT connection EMPTY>
<!ATTLIST connection
t1 CDATA #REQUIRED
t2 CDATA #REQUIRED
>
<!ELEMENT remove-connection EMPTY>
<!ATTLIST remove-connection
t1 CDATA #REQUIRED
t2 CDATA #REQUIRED
>
<!ELEMENT resourceList (resource+) >
<!ELEMENT resource EMPTY>
<!ATTLIST resource
name ID #REQUIRED
>
<!ELEMENT unitList (unit+) >
<!ELEMENT unit EMPTY>
<!ATTLIST unit
name ID #REQUIRED
>
<!ELEMENT relationshipTypes (relationshipType+) >
<!ELEMENT relationshipType EMPTY>
<!ATTLIST relationshipType
name ID #REQUIRED
>
<!ELEMENT playerList (player+, alliance*) >
<!ELEMENT player EMPTY>
<!ATTLIST player
name ID #REQUIRED
optional (true | false) 'false'
canBeDisabled (true | false) 'false'
>
<!ELEMENT alliance EMPTY>
<!ATTLIST alliance
player IDREF #REQUIRED
alliance CDATA #REQUIRED
>
<!ELEMENT territoryEffectList (territoryEffect+) >
<!ELEMENT territoryEffect EMPTY>
<!ATTLIST territoryEffect
name ID #REQUIRED
>
<!ELEMENT gamePlay (delegate+, sequence, offset?)>
<!ELEMENT delegate EMPTY>
<!-- javaClass must implement Delegate
1 instance created per delegate declaration, ie 1 instance per name -->
<!ATTLIST delegate
name ID #REQUIRED
javaClass CDATA #REQUIRED
display CDATA #IMPLIED
>
<!-- if no player given, then delegate is initialized with a null player -->
<!-- max run count is the maximum number of times that a delegate can run, if specified must be > 0, if not specified its infinity-->
<!ELEMENT sequence (step+)>
<!ELEMENT step (stepProperty*)>
<!ATTLIST step
name ID #REQUIRED
delegate IDREF #REQUIRED
player IDREF #IMPLIED
maxRunCount CDATA #IMPLIED
display CDATA #IMPLIED
>
<!ELEMENT stepProperty EMPTY>
<!ATTLIST stepProperty
name CDATA #REQUIRED
value CDATA #REQUIRED
>
<!ELEMENT offset EMPTY>
<!ATTLIST offset
round CDATA #REQUIRED
>
<!ELEMENT production (productionRule+, repairRule*, repairFrontier*, productionFrontier+, playerProduction+, playerRepair*)>
<!ELEMENT productionRule (cost+ , result+)>
<!ATTLIST productionRule
name ID #REQUIRED
>
<!ELEMENT cost EMPTY>
<!ATTLIST cost
resource IDREF #REQUIRED
quantity CDATA #REQUIRED
>
<!ELEMENT result EMPTY>
<!ATTLIST result
resourceOrUnit IDREF #REQUIRED
quantity CDATA #REQUIRED
>
<!ELEMENT repairRule (cost+ , result+)>
<!ATTLIST repairRule
name ID #REQUIRED
>
<!ELEMENT repairFrontier (repairRules+)>
<!ATTLIST repairFrontier
name ID #REQUIRED
>
<!ELEMENT repairRules EMPTY>
<!ATTLIST repairRules
name IDREF #REQUIRED
>
<!ELEMENT productionFrontier (frontierRules+)>
<!ATTLIST productionFrontier
name ID #REQUIRED
>
<!ELEMENT frontierRules EMPTY>
<!ATTLIST frontierRules
name IDREF #REQUIRED
>
<!ELEMENT playerProduction EMPTY>
<!ATTLIST playerProduction
player IDREF #REQUIRED
frontier IDREF #REQUIRED
>
<!ELEMENT playerRepair EMPTY>
<!ATTLIST playerRepair
player IDREF #REQUIRED
frontier IDREF #REQUIRED
>
<!ELEMENT technology (technologies?,playerTech*)>
<!ELEMENT technologies (techname+)>
<!ELEMENT techname EMPTY>
<!ATTLIST techname
name ID #REQUIRED
tech CDATA ""
>
<!ELEMENT playerTech (category*)>
<!ATTLIST playerTech
player IDREF #REQUIRED
>
<!ELEMENT category (tech*)>
<!ATTLIST category
name CDATA #REQUIRED
>
<!ELEMENT tech EMPTY>
<!ATTLIST tech
name IDREF #REQUIRED
>
<!-- attachments must implement Attachment -->
<!ELEMENT attachmentList (attachment+) >
<!ELEMENT attachment (option+) >
<!ATTLIST attachment
name CDATA #REQUIRED
attachTo CDATA #REQUIRED
javaClass CDATA #REQUIRED
type (unitType | territory | resource | player | relationship | territoryEffect | technology) "unitType"
>
<!ELEMENT option EMPTY >
<!ATTLIST option
name CDATA #REQUIRED
value CDATA #REQUIRED
count CDATA ""
>
<!ELEMENT initialize (ownerInitialize?, unitInitialize?, resourceInitialize?, relationshipInitialize?) >
<!ELEMENT ownerInitialize (territoryOwner+) >
<!ELEMENT territoryOwner EMPTY>
<!ATTLIST territoryOwner
territory CDATA #REQUIRED
owner IDREF #REQUIRED
>
<!ELEMENT unitInitialize (unitPlacement*, heldUnits*) >
<!-- units are owned by no one if owner isnt set -->
<!ELEMENT unitPlacement EMPTY>
<!ATTLIST unitPlacement
unitType IDREF #REQUIRED
territory CDATA #REQUIRED
quantity CDATA #REQUIRED
owner IDREF #IMPLIED
hitsTaken CDATA #IMPLIED
unitDamage CDATA #IMPLIED
>
<!-- units that have not been placed yet -->
<!ELEMENT heldUnits EMPTY>
<!ATTLIST heldUnits
unitType IDREF #REQUIRED
player IDREF #REQUIRED
quantity CDATA #REQUIRED
>
<!ELEMENT resourceInitialize (resourceGiven+) >
<!ELEMENT resourceGiven EMPTY>
<!ATTLIST resourceGiven
player IDREF #REQUIRED
resource IDREF #REQUIRED
quantity CDATA #REQUIRED
>
<!ELEMENT relationshipInitialize (relationship+) >
<!ELEMENT relationship EMPTY>
<!ATTLIST relationship
player1 IDREF #REQUIRED
player2 IDREF #REQUIRED
type IDREF #REQUIRED
roundValue CDATA #REQUIRED
>
<!ELEMENT propertyList (property*)>
<!ELEMENT property (boolean?, string?, file?, number?, color?, list?, value?) >
<!-- can the player edit this on start up? if true then the type must be specified with a nested element -->
<!ATTLIST property
value CDATA ""
name CDATA #REQUIRED
editable (true | false) "false"
player CDATA ""
>
<!ELEMENT value (#PCDATA)>
<!ELEMENT boolean EMPTY>
<!ATTLIST boolean
>
<!ELEMENT string EMPTY>
<!ATTLIST string
>
<!ELEMENT file EMPTY>
<!ATTLIST string
>
<!ELEMENT number EMPTY>
<!-- currently only integers are supported -->
<!ATTLIST number
max CDATA #REQUIRED
min CDATA #REQUIRED
>
<!ELEMENT color EMPTY>
<!ATTLIST color
>
<!ELEMENT list EMPTY>
<!-- a comma seperated list of possible values -->
<!ATTLIST list
values CDATA #REQUIRED
>