Javadoc, small bugfix in levels.xml
[AntiTD.git] / src / resources / levels.xsd
blobd84f8039cc1a6fc7100fab9973177513714a9a21
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3 <xs:simpleType name="itemAttributeType">
4 <xs:restriction base="xs:string">
5 <xs:enumeration value="Health"/>
6 <xs:enumeration value="SpeedBoost"/>
7 </xs:restriction>
8 </xs:simpleType>
10 <xs:simpleType name="squareAttributeType">
11 <xs:restriction base="xs:string">
12 <xs:enumeration value="TowerSquare"/>
13 <xs:enumeration value="TurnSquare"/>
14 <xs:enumeration value="PathSquare"/>
15 <xs:enumeration value="BlockedSquare"/>
16 <xs:enumeration value="GoalSquare"/>
17 <xs:enumeration value="StartSquare"/>
18 </xs:restriction>
19 </xs:simpleType>
21 <xs:simpleType name="towerAttributeType">
22 <xs:restriction base="xs:string">
23 <xs:enumeration value="BasicTower"/>
24 </xs:restriction>
25 </xs:simpleType>
27 <xs:simpleType name="directionAttributeType">
28 <xs:restriction base="xs:string">
29 <xs:enumeration value="UP"/>
30 <xs:enumeration value="DOWN"/>
31 <xs:enumeration value="LEFT"/>
32 <xs:enumeration value="RIGHT"/>
33 </xs:restriction>
34 </xs:simpleType>
37 <!-- root -->
38 <xs:element name="levels">
39 <xs:complexType>
40 <xs:sequence>
41 <xs:element minOccurs="1" maxOccurs="unbounded" ref="level"/>
42 </xs:sequence>
43 </xs:complexType>
44 </xs:element>
46 <xs:element name="level">
47 <xs:complexType>
48 <xs:sequence>
49 <xs:element maxOccurs="unbounded" ref="towers"/>
50 <xs:element minOccurs="1" maxOccurs="unbounded" ref="row"/>
51 </xs:sequence>
52 <xs:attribute name="name" use="required" type="xs:string"/>
53 <xs:attribute name="unitsToWin" use="required" type="xs:integer"/>
54 </xs:complexType>
55 </xs:element>
57 <xs:element name="towers">
58 <xs:complexType>
59 <xs:sequence>
60 <xs:element maxOccurs="unbounded" ref="tower"/>
61 </xs:sequence>
62 </xs:complexType>
63 </xs:element>
65 <xs:element name="tower">
66 <xs:complexType>
67 <xs:attribute name="type" use="required" type="towerAttributeType"/>
68 </xs:complexType>
69 </xs:element>
71 <xs:element name="row">
72 <xs:complexType>
73 <xs:sequence>
74 <xs:element minOccurs="3" maxOccurs="unbounded" ref="square"/>
75 </xs:sequence>
76 </xs:complexType>
77 </xs:element>
79 <xs:element name="square">
80 <xs:complexType>
81 <xs:attribute name="type" use="required" type="squareAttributeType"/>
82 <!-- TODO: only StartSquares should have directions from xml -->
83 <xs:attribute name="direction" use="optional" type="directionAttributeType"/>
84 </xs:complexType>
85 </xs:element>
86 </xs:schema>