diff api/Objects/Unit.cs @ 123:52e8c3cdde10

Re #127: Unit creation always assigns default equipment * Add and use new constructor for Unit that doesn't assign default values Re #54: Add Army support to WarFoundryFactory * Load unit name and unit size
author IBBoard <dev@ibboard.co.uk>
date Mon, 24 Aug 2009 19:30:19 +0000
parents 2f3cafb69799
children c60fd5664698
line wrap: on
line diff
--- a/api/Objects/Unit.cs	Sun Aug 23 11:07:47 2009 +0000
+++ b/api/Objects/Unit.cs	Mon Aug 24 19:30:19 2009 +0000
@@ -28,12 +28,16 @@
 
 		public Unit(UnitType unitType, ArmyCategory parentArmyCat) : this(unitType, unitType.MinSize, parentArmyCat) { }
 
-		public Unit(UnitType unitType, int startSize, ArmyCategory parentArmyCat)
+		public Unit(UnitType unitType, int startSize, ArmyCategory parentArmyCat) : this("", "", startSize, unitType, parentArmyCat)
+		{
+			SetInitialEquipment();
+		}		
+		
+		public Unit(string id, string name, int startSize, UnitType unitType, ArmyCategory parentArmyCat) : base(id, name)
 		{
 			Category = parentArmyCat;
 			type = unitType;
 			Size = startSize;
-			SetInitialEquipment();
 			CalcCost();
 			UnitEquipmentAmountChanged+= new DoubleValChangedDelegate(UnitEquipmentAmountChangedHandler);
 			UnitSizeChanged+= new IntValChangedDelegate(UnitSizeChangedHandler);