summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-18 18:23:54 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-18 18:23:54 -0400
commit103587c2d5f9deb20e549a86cdf5023b429cc6a1 (patch)
treef1e2fc60b86395e0cc40646ad1e4396a835b682f /res
parent2ec163612042bfa5e4e1bf220b489506f7039677 (diff)
downloadtherapy-103587c2d5f9deb20e549a86cdf5023b429cc6a1.tar.gz
therapy-103587c2d5f9deb20e549a86cdf5023b429cc6a1.tar.bz2
therapy-103587c2d5f9deb20e549a86cdf5023b429cc6a1.zip
Wrote an XML Schema describing maps file and also changed the spec a bit
Diffstat (limited to 'res')
-rw-r--r--res/maps.xml8
-rw-r--r--res/maps.xsd92
2 files changed, 96 insertions, 4 deletions
diff --git a/res/maps.xml b/res/maps.xml index 594cd18..444e59f 100644 --- a/res/maps.xml +++ b/res/maps.xml
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="ISO-8859-1"?> 1<?xml version="1.0" encoding="ISO-8859-1"?>
2<world><nextmapid>5</nextmapid><lastmap>4</lastmap><root>0</root><startpos id="0" pos="203,44"/><map id="0"><name>Everything Is Embarrassing</name><environment>0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,20,0,0,0,0,0,0,0,18,9,8,10,8,11,8,10,10,8,11,8,9,10,21,0, 2<world nextmap="5" lastmap="4" startx="203" starty="44" startmap="0"><root>0</root><map id="0" title="Everything Is Embarrassing" expanded="true"><environment type="0">0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,20,0,0,0,0,0,0,0,18,9,8,10,8,11,8,10,10,8,11,8,9,10,21,0,
30,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,22,21, 30,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,22,21,
40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,8,8,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12, 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,8,8,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,
50,19,0,0,0,0,0,0,0,0,0,0,0,18,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12, 50,19,0,0,0,0,0,0,0,0,0,0,0,18,8,8,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,
@@ -23,7 +23,7 @@
230,0,0,0,24,3,1,2,1,1,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,27,1,3,2,26,0,0,0,0,0,0, 230,0,0,0,24,3,1,2,1,1,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,27,1,3,2,26,0,0,0,0,0,0,
241,2,3,1,25,0,0,0,0,0,20,0,0,0,0,0,0,19,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,27,1,2,2,4,3,1, 241,2,3,1,25,0,0,0,0,0,20,0,0,0,0,0,0,19,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,27,1,2,2,4,3,1,
250,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0, 250,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,
26</environment><leftmap type="warp" map="1"/><rightmap type="wall"/><upmap type="wall"/><downmap type="wall"/><entities/><child>1</child><child>4</child><expanded>1</expanded></map><map id="1"><name>It's A Trap!</name><environment>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 26</environment><adjacent dir="left" type="warp" map="1" /><child>1</child><child>4</child></map><map id="1" title="It's A Trap!"><environment type="0">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0, 270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,
280,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0, 280,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,
290,0,0,0,0,0,0,19,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 290,0,0,0,0,0,0,19,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -47,7 +47,7 @@
470,0,0,27,2,2,3,3,3,4,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 470,0,0,27,2,2,3,3,3,4,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
480,20,0,0,0,0,0,19,0,0,27,1,1,1,2,2,2,26,0,0,0,0,0,0,0,0,0,0,24,4,2,2,1,3,2,2,1,2,2,3, 480,20,0,0,0,0,0,19,0,0,27,1,1,1,2,2,2,26,0,0,0,0,0,0,0,0,0,0,24,4,2,2,1,3,2,2,1,2,2,3,
490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,19,0,0,0,0,0, 490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,19,0,0,0,0,0,
50</environment><leftmap type="wall"/><rightmap type="warp" map="0"/><upmap type="wall"/><downmap type="warp" map="4"/><entities><entity><entity-type>checkpoint</entity-type><entity-position>262,156</entity-position></entity></entities></map><map id="4"><name>The Visitors</name><environment>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0, 50</environment><entity type="checkpoint" x="262" y="156" /><adjacent dir="right" type="warp" map="0" /><adjacent dir="down" type="warp" map="4" /></map><map id="4" title="The Visitors"><environment type="0">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,
510,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,20,0,0,0,0, 510,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,20,0,0,0,0,
520,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0, 520,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,
530,0,0,0,19,0,0,0,0,0,0,0,0,0,20,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0, 530,0,0,0,19,0,0,0,0,0,0,0,0,0,20,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,
@@ -71,4 +71,4 @@
710,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0, 710,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,
720,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,15,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0, 720,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,15,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,
730,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0, 730,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,
74</environment><leftmap type="wall"/><rightmap type="wall"/><upmap type="warp" map="1"/><downmap type="wall"/><entities/></map></world> 74</environment><adjacent dir="up" type="warp" map="1" /><adjacent dir="down" type="wrap" /></map></world>
diff --git a/res/maps.xsd b/res/maps.xsd new file mode 100644 index 0000000..9d36fab --- /dev/null +++ b/res/maps.xsd
@@ -0,0 +1,92 @@
1<?xml version="1.0"?>
2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3 <xs:simpleType name="map">
4 <xs:restriction base="xs:integer">
5 <xs:minInclusive value="0" />
6 </xs:restriction>
7 </xs:simpleType>
8
9 <xs:simpleType name="move-type">
10 <xs:restriction base="xs:string">
11 <xs:enumeration value="wall" />
12 <xs:enumeration value="wrap" />
13 <xs:enumeration value="warp" />
14 <xs:enumeration value="reverseWarp" />
15 </xs:restriction>
16 </xs:simpleType>
17
18 <xs:simpleType name="direction">
19 <xs:restriction base="xs:string">
20 <xs:enumeration value="left" />
21 <xs:enumeration value="right" />
22 <xs:enumeration value="up" />
23 <xs:enumeration value="down" />
24 </xs:restriction>
25 </xs:simpleType>
26
27 <xs:element name="world">
28 <xs:complexType>
29 <xs:sequence>
30 <xs:element name="root" type="map" maxOccurs="unbounded" />
31
32 <xs:element name="map" maxOccurs="unbounded">
33 <xs:complexType>
34 <xs:sequence>
35 <xs:element name="environment">
36 <xs:complexType>
37 <xs:simpleContent>
38 <xs:extension base="xs:string">
39 <xs:attribute name="type" use="required">
40 <xs:simpleType>
41 <xs:restriction base="xs:integer">
42 <xs:minInclusive value="0" />
43 <xs:maxExclusive value="5" />
44 </xs:restriction>
45 </xs:simpleType>
46 </xs:attribute>
47 </xs:extension>
48 </xs:simpleContent>
49 </xs:complexType>
50 </xs:element>
51
52 <xs:element name="entity" minOccurs="0" maxOccurs="unbounded">
53 <xs:complexType>
54 <xs:attribute name="type" type="xs:string" use="required" />
55 <xs:attribute name="x" type="xs:integer" use="required" />
56 <xs:attribute name="y" type="xs:integer" use="required" />
57 </xs:complexType>
58 </xs:element>
59
60 <xs:element name="adjacent" minOccurs="0" maxOccurs="4">
61 <xs:complexType>
62 <xs:attribute name="dir" type="direction" use="required" />
63 <xs:attribute name="type" type="move-type" use="required" />
64 <xs:attribute name="map" type="map" default="0" />
65 </xs:complexType>
66 </xs:element>
67
68 <xs:element name="child" type="map" minOccurs="0" maxOccurs="unbounded" />
69 </xs:sequence>
70
71 <xs:attribute name="id" type="xs:integer" use="required" />
72 <xs:attribute name="expanded" type="xs:boolean" default="false" />
73 <xs:attribute name="title" use="required">
74 <xs:simpleType>
75 <xs:restriction base="xs:string">
76 <xs:maxLength value="40" />
77 </xs:restriction>
78 </xs:simpleType>
79 </xs:attribute>
80 </xs:complexType>
81 </xs:element>
82 </xs:sequence>
83
84 <xs:attribute name="nextmap" type="map" default="0" />
85 <xs:attribute name="lastmap" type="map" default="0" />
86 <xs:attribute name="startx" type="xs:integer" use="required" />
87 <xs:attribute name="starty" type="xs:integer" use="required" />
88 <xs:attribute name="startmap" type="map" use="required" />
89 </xs:complexType>
90 </xs:element>
91
92</xs:schema>