diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-18 18:23:54 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-18 18:23:54 -0400 |
| commit | 103587c2d5f9deb20e549a86cdf5023b429cc6a1 (patch) | |
| tree | f1e2fc60b86395e0cc40646ad1e4396a835b682f /res/maps.xsd | |
| parent | 2ec163612042bfa5e4e1bf220b489506f7039677 (diff) | |
| download | therapy-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/maps.xsd')
| -rw-r--r-- | res/maps.xsd | 92 |
1 files changed, 92 insertions, 0 deletions
| 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> | ||
