XML event definitions

Added a dummy event definitions file, and more importantly the
associated XML schema.
This commit is contained in:
Emmanuel BENOîT 2012-06-30 14:30:46 +02:00
parent aaec345957
commit 7e3d8a558a
3 changed files with 178 additions and 0 deletions

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<lw-event-definitions xmlns="http://www.deepclone.com/lw/b6/m2/event-definitions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.deepclone.com/lw/b6/m2/event-definitions event-definitions.xsd">
<!-- An item in one of the build queues has been completed -->
<evdef id="bq-progress" priority="0" i18n-strings="evtBQProgress">
<boolean id="is-military" />
<boolean id="is-construction" />
<entity id="planet" entity-type="PLN" required="0" />
<text id="planet-name" max-length="20" />
<i18n id="nature" />
</evdef>
<!-- A build queue is empty -->
<evdef id="bq-empty" priority="1" i18n-strings="evtBQEmpty">
<boolean id="is-military" />
<entity id="planet" entity-type="PLN" required="0" />
<text id="planet-name" max-length="20" />
</evdef>
<!-- A research is ready to be implemented -->
<evdef id="research-complete" i18n-strings="evtResearch">
<i18n id="technology" />
</evdef>
</lw-event-definitions>

View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.deepclone.com/lw/b6/m2/event-definitions"
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.deepclone.com/lw/b6/m2/event-definitions"
xmlns:tns="http://www.deepclone.com/lw/b6/m2/event-definitions"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Root element, contains a sequence of event definitions -->
<xs:element name="lw-event-definitions">
<xs:complexType>
<xs:sequence>
<xs:element name="evdef" type="evdef" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Event definitions. Needs an ID and an I18N base, may also provide information
about the event's priority. May contain a list of field definitions. -->
<xs:complexType name="evdef">
<xs:sequence>
<xs:group ref="evdef-field" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:token" />
<xs:attribute name="priority" use="optional" default="2"
type="priority-value" />
<xs:attribute name="adjustable" use="optional" type="xs:boolean"
default="true" />
<xs:attribute name="i18n-strings" use="required" type="xs:token" />
</xs:complexType>
<!-- Priority values are integers in [0;4] -->
<xs:simpleType name="priority-value">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="4" />
</xs:restriction>
</xs:simpleType>
<!-- Field definitions -->
<xs:group name="evdef-field">
<xs:choice>
<xs:element name="boolean" type="field-base" />
<xs:element name="i18n" type="field-base" />
<xs:element name="integer" type="field-integer" />
<xs:element name="real" type="field-real" />
<xs:element name="text" type="field-text" />
<xs:element name="entity" type="field-entity" />
</xs:choice>
</xs:group>
<!-- Common parts for all field definitions -->
<xs:complexType name="field-base">
<xs:attribute name="id" use="required" type="xs:token" />
<xs:attribute name="required" use="optional" type="xs:boolean"
default="true" />
</xs:complexType>
<!-- Integer field definition -->
<xs:complexType name="field-integer">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min" use="optional" type="xs:integer" />
<xs:attribute name="max" use="optional" type="xs:integer" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Real field definition -->
<xs:complexType name="field-real">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min" use="optional" type="xs:double" />
<xs:attribute name="max" use="optional" type="xs:double" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Text field definition -->
<xs:complexType name="field-text">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min-length" use="optional" type="xs:integer" />
<xs:attribute name="max-length" use="optional" type="xs:integer" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Entity field definition -->
<xs:complexType name="field-entity">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="entity-type" use="required" type="entity-types" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Supported entity types -->
<xs:simpleType name="entity-types">
<xs:restriction base="xs:string">
<xs:enumeration value="EMP" />
<xs:enumeration value="PLN" />
<xs:enumeration value="FLT" />
<xs:enumeration value="ALL" />
<xs:enumeration value="BAT" />
<xs:enumeration value="ADM" />
<xs:enumeration value="BUG" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

View file

@ -569,6 +569,26 @@ It was disbanded.</value>
<inline-string id="rdNothentium"> <inline-string id="rdNothentium">
<value>(Get Doug or Rendesh to write this)</value> <value>(Get Doug or Rendesh to write this)</value>
</inline-string> </inline-string>
<!-- Event names and templates -->
<inline-string id="evtBQProgressName">
<value>Build queue progress</value>
</inline-string>
<inline-string id="evtBQProgressTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
<inline-string id="evtBQEmptyName">
<value>Empty build queue</value>
</inline-string>
<inline-string id="evtBQEmptyTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
<inline-string id="evtResearchName">
<value>Technological breakthrough</value>
</inline-string>
<inline-string id="evtResearchTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
</language> </language>
@ -1139,6 +1159,27 @@ Elle a été dissoute.</value>
<value>(À traduire quand il y aura une version anglaise)</value> <value>(À traduire quand il y aura une version anglaise)</value>
</inline-string> </inline-string>
<!-- Event names and templates -->
<inline-string id="evtBQProgressName">
<value>Avancement des constructions</value>
</inline-string>
<inline-string id="evtBQProgressTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
<inline-string id="evtBQEmptyName">
<value>File de construction vide</value>
</inline-string>
<inline-string id="evtBQEmptyTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
<inline-string id="evtResearchName">
<value>Découverte scientifique</value>
</inline-string>
<inline-string id="evtResearchTemplate">
<value>FIXME: this should be some FreeMarker code in a file</value>
</inline-string>
</language> </language>
</lw-text-data> </lw-text-data>