comparison 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
comparison
equal deleted inserted replaced
459:7a00aeba3d2f 460:025319b6fa7a
496 { 496 {
497 List<IRequirement> reqs = new List<IRequirement>(requirements); 497 List<IRequirement> reqs = new List<IRequirement>(requirements);
498 498
499 if (MinNumber != 0) 499 if (MinNumber != 0)
500 { 500 {
501 //RequiresAtLeastNUnitsRequirement<Army> req = new RequiresAtLeastNUnitsRequirement<Army>(); 501 RaceRequiresAtLeastNUnitsRequirement req = new RaceRequiresAtLeastNUnitsRequirement(Race);
502 //req.AddUnitTypeRequirement(this, MinNumber); 502 req.AddUnitTypeRequirement(this, MinNumber);
503 //reqs.Add(req); 503 reqs.Add(req);
504 } 504 }
505 505
506 if (MaxNumber != WarFoundryCore.INFINITY) 506 if (MaxNumber != WarFoundryCore.INFINITY)
507 { 507 {
508 //RequiresNoMoreThanNOfUnitTypeRequirement<IWarFoundryObject> req = new RequiresNoMoreThanNOfUnitTypeRequirement<IWarFoundryObject>(); 508 RaceRequiresNoMoreThanNUnitsRequirement req = new RaceRequiresNoMoreThanNUnitsRequirement(Race);
509 //req.AddUnitTypeRequirement(this, MaxNumber); 509 req.AddUnitTypeRequirement(this, MaxNumber);
510 //reqs.Add(req); 510 reqs.Add(req);
511 } 511 }
512 512
513 return reqs.ToArray(); 513 return reqs.ToArray();
514 } 514 }
515 515