1
0
forked from mirrors/0ad

# Initial support for automatic validation of entity template XML.

Add RelaxNG schemas for all current components.
Add -dumpSchema command-line option to dump the combined entity schema.
Add a Perl script to validate entity templates against the schema.
See #413.

This was SVN commit r7452.
This commit is contained in:
Ykkrosh
2010-04-09 19:02:39 +00:00
parent 336817a849
commit 40688ec5df
23 changed files with 518 additions and 44 deletions
+18 -21
View File
@@ -75,27 +75,24 @@ public:
bool m_Dirty; // true if position/rotation has changed since last TurnStart
/*
* Schema: (untested)
*
* <element name="Position">
* <interleave>
* <element name="Anchor" a:help="Automatic rotation to follow the slope of terrain">
* <choice>
* <value a:help="Always stand straight up">upright</value>
* <value a:help="Rotate backwards and forwards to follow the terrain">pitch</value>
* <value a:help="Rotate in all direction to follow the terrain">pitch-roll</value>
* </choice>
* </element>
* <element name="Altitude" a:help="Height above terrain in metres">
* <data type="float"/>
* </element>
* <element name="Floating" a:help="Whether the entity floats on water">
* <data type="boolean"/>
* </element>
* </interleave>
* </element>
*/
static std::string GetSchema()
{
return
"<element name='Anchor' a:help='Automatic rotation to follow the slope of terrain'>"
"<choice>"
"<value a:help='Always stand straight up'>upright</value>"
"<value a:help='Rotate backwards and forwards to follow the terrain'>pitch</value>"
"<value a:help='Rotate in all direction to follow the terrain'>pitch-roll</value>"
"</choice>"
"</element>"
"<element name='Altitude' a:help='Height above terrain in metres'>"
"<data type='decimal'/>"
"</element>"
"<element name='Floating' a:help='Whether the entity floats on water'>"
"<data type='boolean'/>"
"</element>";
}
virtual void Init(const CSimContext& context, const CParamNode& paramNode)
{
m_Context = &context;