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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user