diff API/Objects/UnitType.cs @ 460:025319b6fa7a

Re #379: Fix validation of requirements to check for unit * Create max count requirement object * Re-add code for min/max counts as requirements
author IBBoard <dev@ibboard.co.uk>
date Sun, 04 Mar 2012 21:13:52 +0000
parents afc6410e4efc
children cbeee87dc2d3
line wrap: on
line diff
--- a/API/Objects/UnitType.cs	Sun Mar 04 20:27:33 2012 +0000
+++ b/API/Objects/UnitType.cs	Sun Mar 04 21:13:52 2012 +0000
@@ -498,16 +498,16 @@
 
 			if (MinNumber != 0)
 			{
-				//RequiresAtLeastNUnitsRequirement<Army> req = new RequiresAtLeastNUnitsRequirement<Army>();
-				//req.AddUnitTypeRequirement(this, MinNumber);
-				//reqs.Add(req);
+				RaceRequiresAtLeastNUnitsRequirement req = new RaceRequiresAtLeastNUnitsRequirement(Race);
+				req.AddUnitTypeRequirement(this, MinNumber);
+				reqs.Add(req);
 			}
 
 			if (MaxNumber != WarFoundryCore.INFINITY)
 			{
-				//RequiresNoMoreThanNOfUnitTypeRequirement<IWarFoundryObject> req = new RequiresNoMoreThanNOfUnitTypeRequirement<IWarFoundryObject>();
-				//req.AddUnitTypeRequirement(this, MaxNumber);
-				//reqs.Add(req);
+				RaceRequiresNoMoreThanNUnitsRequirement req = new RaceRequiresNoMoreThanNUnitsRequirement(Race);
+				req.AddUnitTypeRequirement(this, MaxNumber);
+				reqs.Add(req);
 			}
 
 			return reqs.ToArray();