<?xml version="1.0" encoding="UTF-8" ?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:element name="maps">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="map" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="map">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="files" />
				<xs:element ref="defendersavailability" />
				<xs:element ref="particles" />
				<xs:element ref="stats" />
				<xs:element ref="waves" />
			</xs:sequence>
			<xs:attribute name="id"			type="xs:string" use="required" />
		</xs:complexType>
	</xs:element>

	<xs:element name="files">
		<xs:complexType>
			<xs:attribute name="mesh"	type="xs:string" use="required" />
      <xs:attribute name="data" type="xs:string" use="required" />
      <xs:attribute name="view" type="xs:string" use="required" />
      <xs:attribute name="music" type="xs:string" use="required" />
    </xs:complexType>
	</xs:element>

	<xs:element name="defendersavailability">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="availability" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="availability">
		<xs:complexType>
			<xs:attribute name="defenderid"	type="xs:string" use="required" />
			<xs:attribute name="wave"		type="xs:unsignedInt" use="required" />
		</xs:complexType>
	</xs:element>

	<xs:element name="particles">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="particle" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="particle">
		<xs:complexType>
			<xs:attribute name="filename"	type="xs:string" use="required" />
			<xs:attribute name="x" type="xs:float" use="required" />
      <xs:attribute name="y" type="xs:float" use="required" />
      <xs:attribute name="z" type="xs:float" use="required" />
    </xs:complexType>
	</xs:element>

	<xs:element name="stats">
		<xs:complexType>
			<xs:attribute name="gold"	type="xs:unsignedInt" use="required" />
      <xs:attribute name="defenderangle" type="xs:unsignedInt" use="required" />
    </xs:complexType>
	</xs:element>

	<xs:element name="waves">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="wave" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="wave">
		<xs:complexType>
      <xs:attribute name="id"			type="xs:unsignedInt" use="required" />
      <xs:attribute name="gold"		type="xs:unsignedInt" use="required" />
      <xs:attribute name="goldbonuspercent"	type="xs:unsignedInt" use="required" />
      <xs:attribute name="survivalbonuspercent"	type="xs:unsignedInt" use="required" />
    </xs:complexType>
	</xs:element>

</xs:schema>