comparison api/Requirements/UnitRequiresAtLeastRequirement.cs @ 230:73da8d13ce69

Re #223: Use translations within the API * Fix build error caused by changing private field types no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Thu, 24 Dec 2009 10:33:20 +0000
parents 6083010a005c
children d1c90159547a
comparison
equal deleted inserted replaced
229:6083010a005c 230:73da8d13ce69
57 protected override AbstractFailedRequirement CanAddToArmy(Army army, UnitType type) 57 protected override AbstractFailedRequirement CanAddToArmy(Army army, UnitType type)
58 { 58 {
59 FailedRequirement failure = null; 59 FailedRequirement failure = null;
60 int count = requiredTypes.Length; 60 int count = requiredTypes.Length;
61 61
62 for (int i = 0; i < count; i++) 62 foreach (UnitRequirementItem req in requiredTypes)
63 { 63 {
64 if (army.GetUnitTypeCount(requiredTypes[i]) < requiredCounts[i]) 64 if (army.GetUnitTypeCount(req.UnitType) < req.Amount)
65 { 65 {
66 failure = new FailedRequirement(this); 66 failure = new FailedRequirement(this);
67 break; 67 break;
68 } 68 }
69 } 69 }