# HG changeset patch # User IBBoard # Date 1301946338 0 # Node ID 407757e597f9c48d4f260d101aedf991e965f673 # Parent 5f94b8a4087607eeae31385384a931283586b6e2 Re #27: Unit requirements * Correct documentation * Add "limit to none" method diff -r 5f94b8a40876 -r 407757e597f9 API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs --- a/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs Mon Apr 04 19:28:44 2011 +0000 +++ b/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs Mon Apr 04 19:45:38 2011 +0000 @@ -20,7 +20,7 @@ foreach (UnitType unitType in limitedUnitTypes) { - AddUnitTypeRequirement(unitType, 0); + AddUnitTypeRequirement(unitType); } } @@ -53,17 +53,28 @@ } /// - /// Adds a requirement for there to be at least minCount of a given UnitType + /// Adds a requirement for there to be no more than maxCount of a given UnitType /// /// - /// The unit type to require. + /// The unit type to limit. /// /// - /// The minimum number of that type that must exist. + /// The maximum number of that type that must exist. /// - public void AddUnitTypeRequirement(UnitType unitType, int minCount) + public void AddUnitTypeRequirement(UnitType unitType, int maxCount) { - limitedTypes.Add(new UnitCountRequirementData(unitType, minCount)); + limitedTypes.Add(new UnitCountRequirementData(unitType, maxCount)); + } + + /// + /// Adds a requirement for there to be none of a given UnitType + /// + /// + /// The unit type to limit. + /// + public void AddUnitTypeRequirement(UnitType unitType) + { + AddUnitTypeRequirement(unitType, 0); } } }