changeset 36:0a1c5fea6a08

Re #32 - Migrate to schemas * Convert Army to schema * Delete old DTDs
author IBBoard <dev@ibboard.co.uk>
date Mon, 16 Mar 2009 20:15:02 +0000
parents 9cac51553fd1
children 465a215a21a2
files IBBoard.WarFoundry.API.csproj dtds/army.dtd dtds/army.xsd dtds/race.dtd dtds/system.dtd
diffstat 5 files changed, 58 insertions(+), 132 deletions(-) [+]
line wrap: on
line diff
--- a/IBBoard.WarFoundry.API.csproj	Sun Mar 15 16:25:49 2009 +0000
+++ b/IBBoard.WarFoundry.API.csproj	Mon Mar 16 20:15:02 2009 +0000
@@ -39,9 +39,6 @@
   <ItemGroup>
     <None Include="COPYING.GPL" />
     <None Include="COPYING.LGPL" />
-    <None Include="dtds\army.dtd" />
-    <None Include="dtds\race.dtd" />
-    <None Include="dtds\system.dtd" />
     <None Include="dtds\system.xsd">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
@@ -54,6 +51,9 @@
     <None Include="dtds\warfoundry-cats.xsd">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="dtds\army.xsd">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="api\Commands\CreateAndAddUnitCommand.cs" />
--- a/dtds/army.dtd	Sun Mar 15 16:25:49 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<!ELEMENT army (units,customEquipment)>
-<!ELEMENT units (unit*)>
-<!ELEMENT unit (equipment?)>
-<!ELEMENT equipment (equipItem*)>
-<!ELEMENT equipItem EMPTY>
-<!ELEMENT customEquipment (customEquipment*)>
-<!ELEMENT customEquip EMPTY>
-
-<!ATTLIST army id CDATA #REQUIRED>
-<!ATTLIST army name CDATA #REQUIRED>
-<!ATTLIST army system CDATA #REQUIRED>
-<!ATTLIST army race CDATA #REQUIRED>
-<!ATTLIST army maxPoints CDATA #REQUIRED>
-
-<!ATTLIST unit id CDATA #REQUIRED>
-<!ATTLIST unit unitType CDATA #REQUIRED>
-<!ATTLIST unit unitName CDATA #REQUIRED>
-<!ATTLIST unit race CDATA "">
-<!ATTLIST unit size CDATA "">
-
-<!ATTLIST equipItem id CDATA #REQUIRED>
-<!ATTLIST equipItem amount CDATA #REQUIRED>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/army.xsd	Mon Mar 16 20:15:02 2009 +0000
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/army" xmlns="http://ibboard.co.uk/warfoundry/army" elementFormDefault="qualified">
+<xs:element name="army">
+  <xs:complexType>
+    <xs:all>
+      <xs:element name="units" type="unitstype" minOccurs="1"/>
+      <xs:element name="customEquipment" type="customequipmenttype" minOccurs="1" />
+    </xs:all>
+    <xs:attribute name="id" type="xs:ID" />
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="system" type="xs:string" use="required"/>
+    <xs:attribute name="race" type="xs:string" use="required"/>
+    <xs:attribute name="maxPoints" type="xs:positiveInteger" use="required"/>
+  </xs:complexType>
+</xs:element>
+<xs:complexType name="unitstype">
+  <xs:sequence>
+    <xs:element name="unit" type="unittype" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="unittype">
+  <xs:all>
+    <xs:element name="equipment" type="equipmenttype" minOccurs="0" maxOccurs="1" />
+  </xs:all>
+  <xs:attribute name="id" type="xs:ID" />
+  <xs:attribute name="unitType" type="xs:string" use="required"/>
+  <xs:attribute name="unitName" type="xs:string" use="required"/>
+  <xs:attribute name="size" type="xs:positiveInteger" use="required"/>
+  <xs:attribute name="race" type="xs:string" default=""/>
+</xs:complexType>
+<xs:complexType name="equipmenttype">
+  <xs:sequence>
+    <xs:element name="equipItem" type="equipitemtype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="equipitemtype">
+  <xs:attribute name="id" type="xs:string" /> <!-- ID reference to either a custom equipment item or a Race equipment item -->
+  <xs:attribute name="amount" type="xs:double" use="required"/><!-- Double used to allow for percentages to be stored -->
+  <xs:attribute name="isCustomEquipment" type="xs:boolean" default="false"/>
+</xs:complexType>
+<xs:complexType name="customequipmenttype">
+  <xs:sequence>
+    <xs:element name="customEquip" type="customequiptype" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="customequiptype">
+  <xs:sequence>
+    <xs:element name="customEquipPart" type="customequipparttype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:ID" />
+</xs:complexType>
+<xs:complexType name="customequipparttype">
+  <xs:attribute name="partIDRef" type="xs:string" />
+</xs:complexType>
+</xs:schema>
\ No newline at end of file
--- a/dtds/race.dtd	Sun Mar 15 16:25:49 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-<!ELEMENT race (units,categories?,equipment?, abilities?)>
-<!ELEMENT categories (cat+)>
-<!ELEMENT cat EMPTY>
-<!ELEMENT units (unit+)>
-<!ELEMENT unit (unitCats,stats,unitEquipment,requires?,exclusiveOf?,champions?,specialItems?,attachable?,additionalMembers?)>
-<!ELEMENT unitCats (unitCat+)>
-<!ELEMENT unitCat EMPTY>
-<!ELEMENT stats (stat+)>
-<!ELEMENT stat (#PCDATA)>
-<!ELEMENT unitEquipment (unitEquipmentItem*)>
-<!ELEMENT unitEquipmentItem EMPTY>
-<!ELEMENT requires (required+)>
-<!ELEMENT required EMPTY>
-<!ELEMENT exclusiveOf (exclusive+)>
-<!ELEMENT exclusive EMPTY>
-<!ELEMENT champions (champion+)>
-<!ELEMENT champion EMPTY>
-<!ELEMENT specialItems (specialItem+)>
-<!ELEMENT specialItem EMPTY>
-<!ELEMENT attachable (attachableUnit+)>
-<!ELEMENT attachableUnit EMPTY>
-<!ELEMENT additionalMembers (additionalMember+)>
-<!ELEMENT additionalMember EMPTY>
-<!ELEMENT equipment (equipmentItem*)>
-<!ELEMENT equipmentItem (stats?)>
-<!ELEMENT abilities (ability?)>
-<!ELEMENT ability (description,requirements)>
-<!ELEMENT description (#PCDATA)>
-<!ELEMENT requirements (requirement*)>
-<!ELEMENT requirement (#PCDATA)>
-
-<!ATTLIST race id ID #REQUIRED>
-<!ATTLIST race subid CDATA "">
-<!ATTLIST race system CDATA #REQUIRED>
-<!ATTLIST race name CDATA #REQUIRED>
-
-<!ATTLIST cat id ID #REQUIRED>
-<!ATTLIST cat name CDATA #REQUIRED>
-<!ATTLIST cat minimum CDATA #REQUIRED>
-<!ATTLIST cat maximum CDATA #REQUIRED>
-<!ATTLIST cat baseValue CDATA #IMPLIED>
-<!ATTLIST cat incValue CDATA #IMPLIED>
-<!ATTLIST cat incAmount CDATA #IMPLIED>
-
-<!ATTLIST unit id ID #REQUIRED>
-<!ATTLIST unit typeName CDATA #REQUIRED>
-<!ATTLIST unit cat CDATA #REQUIRED>
-<!ATTLIST unit unitPoints CDATA "0">
-<!ATTLIST unit points CDATA #REQUIRED>
-<!ATTLIST unit race CDATA "">
-<!ATTLIST unit minNum CDATA "0">
-<!ATTLIST unit maxNum CDATA "-1">
-<!ATTLIST unit minSize CDATA "5">
-<!ATTLIST unit maxSize CDATA "-1">
-<!ATTLIST unit baseSize CDATA "0">
-
-<!ATTLIST unitCat catID CDATA #REQUIRED>
-<!ATTLIST unitCat catCost CDATA "1">
-
-<!ATTLIST stats statSet CDATA "">
-
-<!ATTLIST stat name CDATA #REQUIRED>
-
-<!ATTLIST unitEquipmentItem id CDATA #REQUIRED>
-<!ATTLIST unitEquipmentItem required (true|false) "false">
-<!ATTLIST unitEquipmentItem exclusivityGroup CDATA "">
-<!ATTLIST unitEquipmentItem roundDirection (up|down) "up">
-
-<!ATTLIST equipmentItem id ID #REQUIRED>
-<!ATTLIST equipmentItem name CDATA #REQUIRED>
-<!ATTLIST equipmentItem cost CDATA #REQUIRED>
-<!ATTLIST equipmentItem min CDATA "-1">
-<!ATTLIST equipmentItem max CDATA "-1">
-<!ATTLIST equipmentItem armourType (None|Shield|LightArmour|LightArmourShield|HeavyArmour|HeavyArmourShield|Barding|BardingShield|BardingLightArmour|BardingLightArmourShield|BardingHeavyArmour|BardingHeavyArmourShield) "None">
-
-<!ATTLIST ability id ID #REQUIRED>
-<!ATTLIST ability name CDATA #REQUIRED>
--- a/dtds/system.dtd	Sun Mar 15 16:25:49 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!ELEMENT system (categories,sysStatsList)>
-<!ELEMENT categories (cat+)>
-<!ELEMENT cat EMPTY>
-<!ELEMENT sysStatsList (sysStats+)>
-<!ELEMENT sysStats (sysStat+)>
-<!ELEMENT sysStat EMPTY>
-
-<!ATTLIST system id ID #REQUIRED>
-<!ATTLIST system name CDATA #REQUIRED>
-<!ATTLIST system warn (true|false) "false">
-<!ATTLIST system allowAllies (true|false) "true">
-<!ATTLIST system isRosterBased (true|false) "false">
-
-<!ATTLIST cat id ID #REQUIRED>
-<!ATTLIST cat name CDATA #REQUIRED>
-<!ATTLIST cat minPoints CDATA "0">
-<!ATTLIST cat maxPoints CDATA "-1">
-<!ATTLIST cat minPercentage CDATA "0">
-<!ATTLIST cat maxPercentage CDATA "100">
-<!ATTLIST cat minChoices CDATA "0">
-<!ATTLIST cat maxChoices CDATA "-1">
-<!ATTLIST cat baseValue CDATA "0">
-<!ATTLIST cat incValue CDATA "0">
-<!ATTLIST cat incAmount CDATA "0">
-
-<!ATTLIST sysStatsList defaultStats CDATA #REQUIRED>
-
-<!ATTLIST sysStats id ID #REQUIRED>
-
-<!ATTLIST sysStat name CDATA #REQUIRED>