Skip to content

Instantly share code, notes, and snippets.

@leper
Created November 30, 2014 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leper/a6d45312e07524aba3c0 to your computer and use it in GitHub Desktop.
Save leper/a6d45312e07524aba3c0 to your computer and use it in GitHub Desktop.
in addition to #2936
Index: source/simulation2/components/CCmpFootprint.cpp
===================================================================
--- source/simulation2/components/CCmpFootprint.cpp (revision 16013)
+++ source/simulation2/components/CCmpFootprint.cpp (working copy)
@@ -59,15 +59,15 @@
"<choice>"
"<element name='Square' a:help='Set the footprint to a square of the given size'>"
"<attribute name='width' a:help='Size of the footprint along the left/right direction (in metres)'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='depth' a:help='Size of the footprint along the front/back direction (in metres)'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"<element name='Circle' a:help='Set the footprint to a circle of the given size'>"
"<attribute name='radius' a:help='Radius of the footprint (in metres)'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"</choice>"
Index: source/simulation2/components/CCmpObstruction.cpp
===================================================================
--- source/simulation2/components/CCmpObstruction.cpp (revision 16013)
+++ source/simulation2/components/CCmpObstruction.cpp (working copy)
@@ -112,15 +112,15 @@
"<choice>"
"<element name='Static'>"
"<attribute name='width'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='depth'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"<element name='Unit'>"
"<attribute name='radius'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"<element name='Obstructions'>"
@@ -138,10 +138,10 @@
"</attribute>"
"</optional>"
"<attribute name='width'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='depth'>"
- "<ref name='positiveDecimal'/>"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"</zeroOrMore>"
Index: source/simulation2/components/CCmpVisualActor.cpp
===================================================================
--- source/simulation2/components/CCmpVisualActor.cpp (revision 16013)
+++ source/simulation2/components/CCmpVisualActor.cpp (working copy)
@@ -146,21 +146,21 @@
"</element>"
"<element name='Box' a:help='Sets the selection shape to a box of specified dimensions'>"
"<attribute name='width'>"
- "<ref name='positiveDecimal' />"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='height'>"
- "<ref name='positiveDecimal' />"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='depth'>"
- "<ref name='positiveDecimal' />"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"<element name='Cylinder' a:help='Sets the selection shape to a cylinder of specified dimensions'>"
"<attribute name='radius'>"
- "<ref name='positiveDecimal' />"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"<attribute name='height'>"
- "<ref name='positiveDecimal' />"
+ "<ref name='positiveDecimalAttribute'/>"
"</attribute>"
"</element>"
"</choice>"
Index: source/simulation2/system/ComponentManager.cpp
===================================================================
--- source/simulation2/system/ComponentManager.cpp (revision 16013)
+++ source/simulation2/system/ComponentManager.cpp (working copy)
@@ -1085,9 +1085,14 @@
std::string schema =
"<grammar xmlns='http://relaxng.org/ns/structure/1.0' xmlns:a='http://ns.wildfiregames.com/entity' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>"
"<define name='nonNegativeDecimal'>"
+ "<optional><attribute name='method'/></optional>"
"<data type='decimal'><param name='minInclusive'>0</param></data>"
"</define>"
"<define name='positiveDecimal'>"
+ "<optional><attribute name='method'/></optional>"
+ "<data type='decimal'><param name='minExclusive'>0</param></data>"
+ "</define>"
+ "<define name='positiveDecimalAttribute'>"
"<data type='decimal'><param name='minExclusive'>0</param></data>"
"</define>"
"<define name='anything'>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment