<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="Rounds" targetNamespace="http://www.mdesystems.co.uk/xml/schema/Rounds.xsd" elementFormDefault="qualified" xmlns="http://www.mdesystems.co.uk/xml/schema/Rounds.xsd" xmlns:mstns="http://www.mdesystems.co.uk/xml/schema/Rounds.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <!-- This is the Main Document Outline -->
  <xsd:element name="Rounds">
    <xsd:annotation>
      <xsd:documentation>This contains all the rounds data for all applicable archery rounds</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="GNAS_Rounds" type="RoundCollection" minOccurs="0" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>A List of all Recognised GNAS Rounds</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="FITA_Rounds" type="RoundCollection" minOccurs="0" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>A list of all the recognised FITA Rounds</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="NFAS_Rounds" type="RoundCollection" minOccurs="0" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>A list of all the recognised NFAS Rounds</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
      <xsd:attribute name="Language" type="enmSupportedLanguage">
      </xsd:attribute>
    </xsd:complexType>
  </xsd:element>
  
  <xsd:complexType name="RoundCollection">
    <xsd:sequence>
      <xsd:element name="Round" type="roundType" maxOccurs="unbounded" minOccurs="0" />
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:complexType name="roundType">
    <xsd:sequence>
      <xsd:element name="Round_ID" type="xsd:int">
        <xsd:annotation>
          <xsd:documentation>
            This ID should not be changed from the original ID created by MDESystems.
            Any Handicap or Classification tables that may be distributed at a later date
            will expect the ID's to be as originally specified within this document.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="Name" type="xsd:string">
        <xsd:annotation>
          <xsd:documentation>The name of the round</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="NumberOfDistances" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>The number of distances (Target only)</xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:int">
            <xsd:minInclusive value="0" />
            <xsd:maxInclusive value="4" />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name="FirstDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The first distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="SecondDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The second distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ThirdDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The third distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ForthDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The forth distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxScoreFirstDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The maximum possible score for the first distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxScoreSecondDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The maximum possible score for the second distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxScoreThirdDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The maximum possible score for the third distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxScoreForthDistance" type="xsd:int" default="0">
        <xsd:annotation>
          <xsd:documentation>The maximum possible score for the forth distance in the round (Target Only)</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxTotalScore" type="xsd:int" minOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The Maximum score for the entire round</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MaxHits" type="xsd:int" minOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The maximum amount of hits for this round</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="MeasurementUnits" default="Metres">
        <xsd:annotation>
          <xsd:documentation>The unit used to measure the different distances.</xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:pattern value="Metres|Yards" />
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name="TotalScoreDivisibleBy" default="1" minOccurs="1">
        <xsd:annotation>
          <xsd:documentation>This only really applies to field shooting to ensure that the total score is physically possible to attain.</xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2|5">
            </xsd:pattern>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
      <xsd:element name="Discipline" type="enmDisciplineType">
        <xsd:annotation>
          <xsd:documentation>The discipline that this round belongs to.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ValidForHandicapCalculations" type="xsd:boolean">
        <xsd:annotation>
          <xsd:documentation>Flag to indicate that the round is valid for GNAS Handicap calculations</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <xsd:simpleType name="enmSupportedLanguage">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration id="EN" value="EN">
        <xsd:annotation>
          <xsd:documentation>English</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="FR" value="FR">
        <xsd:annotation>
          <xsd:documentation>French</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="DE" value="DE">
        <xsd:annotation>
          <xsd:documentation>German</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="ES" value="ES">
        <xsd:annotation>
          <xsd:documentation>Spanish</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType>
  
  <xsd:simpleType name="enmDisciplineType">
    <xsd:restriction base="xsd:int">
      <xsd:enumeration id="NotApplicable" value="0">
        <xsd:annotation>
          <xsd:documentation>NotApplicable</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Target_Outdoor" value="1">
        <xsd:annotation>
          <xsd:documentation>Target Outdoor</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Target_Indoor" value="2">
        <xsd:annotation>
          <xsd:documentation>Target Indoor</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Clout" value="3">
        <xsd:annotation>
          <xsd:documentation>Clout</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Field" value="4">
        <xsd:annotation>
          <xsd:documentation>Field</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Popin_Jay" value="5">
        <xsd:annotation>
          <xsd:documentation>Popin Jay</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Flight" value="6">
        <xsd:annotation>
          <xsd:documentation>Flight</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Golf" value="7">
        <xsd:annotation>
          <xsd:documentation>Golf</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Run" value="8">
        <xsd:annotation>
          <xsd:documentation>Run</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Ski" value="9">
        <xsd:annotation>
          <xsd:documentation>Ski</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="FITA_3D" value="10">
        <xsd:annotation>
          <xsd:documentation>FITA 3D</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      <xsd:enumeration id="Darts" value="11">
        <xsd:annotation>
          <xsd:documentation>Darts</xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>
