Update long neglected saved game schema.

This commit is contained in:
Mike Pope 2017-02-13 22:06:32 +10:30
parent b7f8f6a6f2
commit 2500200c2c
12 changed files with 224 additions and 43 deletions

View File

@ -48,8 +48,10 @@
<xs:element name="cashInTreasureTrainMission" type="SimpleMissionType" />
<xs:element name="defendSettlementMission">
<xs:complexType>
<xs:attribute name="unit" type="UnitId" use="required" />
<xs:attribute name="settlement" type="SettlementId" use="required" />
<!-- @compat 0.11.x -->
<xs:attribute name="unit" type="UnitId" use="optional" />
<!-- end @compat 0.11.x -->
</xs:complexType>
</xs:element>
<xs:element name="idleAtColonyMission" type="SimpleMissionType" />
@ -67,10 +69,18 @@
<xs:attribute name="completed" type="xs:boolean" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="missionaryMission">
<xs:complexType>
<xs:attribute name="target" type="LocationId" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="pioneeringMission">
<xs:complexType>
<xs:attribute name="unit" type="UnitId" use="required" />
<xs:attribute name="tileImprovementPlan" type="TileImprovementPlanId" use="optional" />
<xs:attribute name="target" type="TileId" use="required" />
<xs:attribute name="tileImprovementPlan" type="TileImprovementPlanId" use="required" />
<!-- @compat 0.11.x -->
<xs:attribute name="unit" type="UnitId" use="optional" />
<!-- end @compat 0.11.x -->
</xs:complexType>
</xs:element>
<xs:element name="privateerMission">
@ -81,7 +91,23 @@
<xs:element name="scoutingMission" type="SimpleMissionType" />
<xs:element name="transportMission">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="cargo">
<xs:complexType>
<xs:attribute name="carrier" type="UnitId" use="required"/>
<xs:attribute name="cdst" type="LocationId" use="required"/>
<xs:attribute name="cwait" type="LocationId" use="required"/>
<xs:attribute name="fallback" type="xs:boolean" use="required"/>
<xs:attribute name="id" type="UnitId" use="required"/>
<xs:attribute name="mode" type="CargoMode" use="required"/>
<xs:attribute name="space" type="xs:int" use="required"/>
<xs:attribute name="tries" type="xs:int" use="required"/>
<xs:attribute name="turns" type="xs:int" use="required"/>
<xs:attribute name="tdst" type="LocationId" use="required"/>
<xs:attribute name="twait" type="LocationId" use="required"/>
</xs:complexType>
</xs:element>
<!-- @compat 0.11.x -->
<xs:element name="transportable">
<xs:complexType>
<xs:attribute name="id" type="TransportableId" use="required"/>
@ -90,8 +116,12 @@
<!-- end @compat -->
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="unit" type="UnitId" use="required" />
<!-- end @compat 0.11.x -->
</xs:choice>
<xs:attribute name="target" type="LocationId" use="required" />
<!-- @compat 0.11.x -->
<xs:attribute name="unit" type="UnitId" use="optional" />
<!-- end @compat 0.11.x -->
</xs:complexType>
</xs:element>
<xs:element name="unitSeekAndDestroyMission">
@ -104,14 +134,18 @@
<xs:element name="unitWanderMission" type="SimpleMissionType" />
<xs:element name="wishRealizationMission">
<xs:complexType>
<xs:attribute name="unit" type="UnitId" use="required" />
<xs:attribute name="wish" type="WishId" use="optional" />
<xs:attribute name="wish" type="WishId" use="required" />
<!-- @compat 0.11.x -->
<xs:attribute name="unit" type="UnitId" use="optional" />
<!-- end @compat 0.11.x -->
</xs:complexType>
</xs:element>
<xs:element name="workInsideColonyMission">
<xs:complexType>
<xs:attribute name="unit" type="UnitId" use="required" />
<xs:attribute name="colony" type="ColonyId" use="optional" />
<xs:attribute name="colony" type="ColonyId" use="required" />
<!-- @compat 0.11.x -->
<xs:attribute name="unit" type="UnitId" use="optional" />
<!-- end @compat 0.11.x -->
</xs:complexType>
</xs:element>
<xs:element name="tileImprovementPlanMission">
@ -125,7 +159,8 @@
<!-- @compat 0.10.7 -->
<xs:attribute name="ID" type="UnitId" use="optional"/>
<!-- end @compat -->
<xs:attribute name="transport" type="UnitId" />
<xs:attribute name="transport" type="UnitId" use="optional"/>
<xs:attribute name="value" type="xs:int" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="aiColony">
@ -139,6 +174,11 @@
<!-- end @compat -->
</xs:complexType>
</xs:element>
<xs:element name="goodsWishListElement">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<!-- @compat 0.11.3 -->
<xs:element name="tileimprovementplanListElement">
<xs:complexType>
@ -154,6 +194,11 @@
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="workerWishListElement">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="id" type="ColonyId" use="required"/>
<!-- @compat 0.10.7 -->
@ -164,6 +209,7 @@
<xs:element name="aiPlayer">
<xs:complexType>
<xs:attribute name="id" type="PlayerId" use="required"/>
<xs:attribute name="randomState" type="xs:string" use="required"/>
<!-- @compat 0.10.7 -->
<xs:attribute name="ID" type="PlayerId" use="optional"/>
<!-- end @compat -->
@ -182,6 +228,18 @@
<xs:attribute name="expertNeeded" type="xs:boolean" />
</xs:complexType>
</xs:element>
<xs:element name="goodsWish">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="destination" type="xs:string" />
<xs:attribute name="transportable" type="TransportableId" />
<xs:attribute name="value" type="xs:int" />
<xs:attribute name="goodsType" type="GoodsTypeId" />
<xs:attribute name="expertNeeded" type="xs:boolean" />
<xs:attribute name="amountRequested" type="xs:int" />
</xs:complexType>
</xs:element>
<!-- @compat 0.11.x -->
<xs:element name="GoodsWish">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required"/>
@ -196,6 +254,7 @@
<xs:attribute name="amountRequested" type="xs:int" />
</xs:complexType>
</xs:element>
<!-- end @compat 0.11.x -->
<xs:element name="aiGoods">
<xs:complexType>
<xs:sequence>
@ -247,4 +306,13 @@
<xs:attribute name="unit" type="UnitId" />
</xs:complexType>
<xs:simpleType name="CargoMode">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="load" />
<xs:enumeration value="unload" />
<xs:enumeration value="pickup" />
<xs:enumeration value="dropoff" />
<xs:enumeration value="dump" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,39 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>
Copyright (C) 2002-2017 The FreeCol Team
This file is part of FreeCol.
FreeCol is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FreeCol is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FreeCol. If not, see http://www.gnu.org/licenses
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="../spec/spec-model.xsd" />
<xs:include schemaLocation="data-tile.xsd" />
<xs:element name="cachedTile">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="tile" />
</xs:choice>
<xs:attribute name="copied" type="xs:boolean" use="required"/>
<xs:attribute name="player" type="PlayerId" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -79,7 +79,7 @@
<xs:simpleType name="LocationId">
<xs:restriction base="xs:string">
<xs:pattern value="(tile|unit|colony|europe|colonyTile|building|indianSettlement):([0-9])+" />
<xs:pattern value="(tile|unit|colony|europe|colonyTile|building|indianSettlement|highSeas):([0-9])+" />
</xs:restriction>
</xs:simpleType>
@ -165,7 +165,7 @@
<xs:simpleType name="TileImprovementPlanId">
<xs:restriction base="xs:string">
<xs:pattern value="tileImprovementPlan:([0-9])+" />
<xs:pattern value="tileImprovementPlan:(am|)([0-9])+" />
</xs:restriction>
</xs:simpleType>

View File

@ -29,13 +29,7 @@
<xs:element name="europe">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="units">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="unit"></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element ref="unit"/>
<xs:element name="unitPrice">
<xs:complexType>
<xs:attribute name="unitType" type="xs:string" use="required"/>
@ -49,6 +43,15 @@
<xs:attribute name="id" type="UnitTypeId" />
</xs:complexType>
</xs:element>
<!-- @compat 0.10.x -->
<xs:element name="units">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="unit"></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- end @compat 0.10.x -->
</xs:choice>
<xs:attribute name="id" type="EuropeId" use="required"/>
<!-- @compat 0.10.x -->

View File

@ -68,6 +68,8 @@
<!-- @compat 0.10.x -->
<xs:attribute name="nextID" type="xs:int" use="optional"/>
<!-- end @compat -->
<xs:attribute name="initialActiveUnitId" type="UnitId" use="optional"/>
</xs:complexType>
</xs:element>

View File

@ -31,17 +31,19 @@
<xs:extension base="StringTemplateType" >
<!-- TODO: remove compatibility code -->
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="strings">
<xs:complexType>
<xs:attribute name="xLength" type="xs:int" use="required"/>
<xs:anyAttribute namespace="##local" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="strings">
<xs:complexType>
<xs:attribute name="xLength" type="xs:int" use="required"/>
<xs:anyAttribute namespace="##local" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="turn" type="xs:int" use="required"/>
<!-- TODO: remove old attribute and make eventType required -->
<xs:attribute name="type" type="HistoryEventType" use="optional"/>
<xs:attribute name="eventType" type="HistoryEventType" use="optional"/>
<xs:attribute name="playerId" type="PlayerId" use="optional"/>
<xs:attribute name="score" type="xs:int" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
@ -62,6 +64,7 @@
<xs:enumeration value="founding_father" />
<xs:enumeration value="found_colony" />
<xs:enumeration value="independence" />
<xs:enumeration value="make_peace" />
<xs:enumeration value="meet_nation" />
<!-- @compat 0.10.7 -->
<xs:enumeration value="ABANDON_COLONY" />

View File

@ -39,14 +39,13 @@
<xs:attribute name="value" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
<xs:element ref="missionary"/>
<xs:element name="units">
<xs:element name="contactLevel">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="unit"/>
</xs:choice>
<xs:attribute name="player" type="PlayerId" use="required"/>
<xs:attribute name="level" type="ContactLevel" use="required"/>
</xs:complexType>
</xs:element>
<xs:element ref="missionary"/>
<xs:element name="ownedUnits">
<xs:complexType>
<xs:attribute name="id" type="UnitId"/>
@ -56,6 +55,16 @@
</xs:complexType>
</xs:element>
<xs:element ref="goodsContainer"/>
<xs:element ref="unit" />
<!-- @compat 0.10.x -->
<xs:element name="units">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="unit"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- end @compat 0.10.x -->
</xs:choice>
<xs:attribute name="id" type="IndianSettlementId" use="required"/>
@ -78,6 +87,8 @@
<xs:attribute name="learnableSkill" type="UnitTypeId"
use="optional"/>
<xs:attribute name="mostHated" type="PlayerId" use="optional"/>
<xs:attribute name="wantedGoods0" type="GoodsTypeId" use="optional"/>
<xs:attribute name="wantedGoods1" type="GoodsTypeId" use="optional"/>
<xs:attribute name="wantedGoods2" type="GoodsTypeId" use="optional"/>
@ -85,6 +96,14 @@
</xs:complexType>
</xs:element>
<xs:simpleType name="ContactLevel">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="uncontacted" />
<xs:enumeration value="contacted" />
<xs:enumeration value="visited" />
<xs:enumeration value="scouted" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -55,16 +55,19 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="key" type="xs:string" use="optional"/>
<!-- @compat 0.10.x -->
<xs:attribute name="ID" type="RegionId" use="optional"/>
<!-- end @compat -->
<xs:attribute name="nameKey" type="xs:string" use="required">
<!-- @compat 0.11.x -->
<xs:attribute name="nameKey" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Key used to retrieve description from Messages
</xs:documentation>
</xs:annotation>
</xs:attribute>
<!-- end @compat 0.11.x -->
<xs:attribute name="claimable" type="xs:boolean" use="optional"
default="false">
<xs:annotation>

View File

@ -35,7 +35,9 @@
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!-- @compat 0.11.x -->
<xs:element ref="serverObjects" />
<!-- end @compat 0.11.x -->
<xs:element ref="game" />
<xs:element ref="aiMain" />
</xs:choice>

View File

@ -23,6 +23,7 @@
</xs:annotation>
<xs:include schemaLocation="../spec/spec-model.xsd" />
<xs:include schemaLocation="data-common.xsd" />
<xs:element name="serverObjects">
<xs:annotation>
@ -33,13 +34,57 @@
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="serverPlayer" />
<xs:element ref="serverUnit" />
<xs:element ref="serverBuilding" />
<xs:element ref="serverColonyTile" />
<xs:element ref="serverColony" />
<xs:element ref="serverEurope" />
<xs:element ref="serverGame" />
<xs:element ref="serverIndianSettlement" />
<xs:element ref="serverPlayer" />
<xs:element ref="serverUnit" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="serverBuilding">
<xs:complexType>
<xs:attribute name="id" type="BuildingId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="serverColony">
<xs:complexType>
<xs:attribute name="id" type="ColonyId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="serverColonyTile">
<xs:complexType>
<xs:attribute name="id" type="ColonyTileId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="serverEurope">
<xs:complexType>
<xs:attribute name="id" type="EuropeId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="serverGame">
<xs:complexType>
<xs:attribute name="id" type="GameId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="serverIndianSettlement">
<xs:complexType>
<xs:attribute name="id" type="IndianSettlementId" use="required"/>
<!-- @compat 0.10.x -->
<xs:attribute name="ID" type="IndianSettlementId" use="optional"/>
<!-- end @compat -->
</xs:complexType>
</xs:element>
<xs:element name="serverPlayer">
<xs:complexType>
<xs:attribute name="id" type="PlayerId" use="required"/>
@ -58,13 +103,4 @@
</xs:complexType>
</xs:element>
<xs:element name="serverIndianSettlement">
<xs:complexType>
<xs:attribute name="id" type="IndianSettlementId" use="required"/>
<!-- @compat 0.10.x -->
<xs:attribute name="ID" type="IndianSettlementId" use="optional"/>
<!-- end @compat -->
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -23,6 +23,7 @@
</xs:annotation>
<xs:include schemaLocation="../spec/spec-model.xsd" />
<xs:include schemaLocation="data-cachedTile.xsd" />
<xs:include schemaLocation="data-colony.xsd" />
<xs:include schemaLocation="data-indianSettlement.xsd" />
<xs:include schemaLocation="data-tileitemcontainer.xsd" />
@ -32,11 +33,15 @@
<xs:element name="tile">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="cachedTile" />
<xs:element ref="colony" />
<xs:element ref="indianSettlement" />
<xs:element ref="tileItemContainer" />
<xs:element ref="unit" />
<!-- @compat 0.10.x -->
<xs:element ref="playerExploredTile" />
<xs:element ref="units" />
<!-- end @compat 0.10.x -->
<!-- @compat 0.11.3 -->
<xs:element ref="tileitemcontainer" />
<!-- end @compat 0.11.3 -->

View File

@ -25,6 +25,7 @@
<xs:include schemaLocation="../spec/spec.xsd" />
<xs:include schemaLocation="data-building.xsd" />
<xs:include schemaLocation="data-cachedTile.xsd" />
<xs:include schemaLocation="data-colony.xsd" />
<xs:include schemaLocation="data-colonyTile.xsd" />
<xs:include schemaLocation="data-europe.xsd" />