|
From: <ev...@us...> - 2011-05-22 14:45:51
|
Revision: 1564
http://rails.svn.sourceforge.net/rails/?rev=1564&view=rev
Author: evos
Date: 2011-05-22 14:45:45 +0000 (Sun, 22 May 2011)
Log Message:
-----------
Added 'quantityIncrement' attribute to <Train>. Not used yet, but may be useful for 1825 kits.
Added comments to 1830/Game.xml and 1830/TileSet.xml to indicate the option to use this new attribute.
Modified Paths:
--------------
trunk/18xx/data/1830/Game.xml
trunk/18xx/data/1830/TileSet.xml
trunk/18xx/rails/game/TrainType.java
Modified: trunk/18xx/data/1830/Game.xml
===================================================================
--- trunk/18xx/data/1830/Game.xml 2011-05-21 10:40:43 UTC (rev 1563)
+++ trunk/18xx/data/1830/Game.xml 2011-05-22 14:45:45 UTC (rev 1564)
@@ -136,6 +136,8 @@
</IfOption>
<IfOption name="Variant" value="Wabash">
<Attributes quantity="7"/>
+ <!-- NOTE: An alternative way to configure an extra train is: quantityIncrement="+1"
+ (the '+' is optional) -->
</IfOption>
</Train>
<Train name="3" majorStops="3" cost="180" quantity="5" startPhase="3">
Modified: trunk/18xx/data/1830/TileSet.xml
===================================================================
--- trunk/18xx/data/1830/TileSet.xml 2011-05-21 10:40:43 UTC (rev 1563)
+++ trunk/18xx/data/1830/TileSet.xml 2011-05-22 14:45:45 UTC (rev 1564)
@@ -111,6 +111,8 @@
<Tile id="15" quantity="2">
<IfOption name="Variant" value="Coalfields,Coalfields&Reading,Wabash">
<Attributes quantity="3"/>
+ <!-- NOTE: An alternative way to configure an extra tile is: quantityIncrement="+1"
+ (the '+' is optional) -->
</IfOption>
<IfOption name="Variant" value="Wabash">
<Upgrade id="63,448"/>
Modified: trunk/18xx/rails/game/TrainType.java
===================================================================
--- trunk/18xx/rails/game/TrainType.java 2011-05-21 10:40:43 UTC (rev 1563)
+++ trunk/18xx/rails/game/TrainType.java 2011-05-22 14:45:45 UTC (rev 1564)
@@ -123,6 +123,8 @@
} else if (quantity <= 0) {
throw new ConfigurationException(
LocalText.getText("InvalidQuantity", String.valueOf(quantity)));
+ } else {
+ quantity += tag.getAttributeAsInteger("quantityIncrement", 0);
}
// Major stops
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|