Mercurial > repos > IBBoard.WarFoundry.API
comparison API/Objects/Requirement/RequiresNUnitsForMUnitsRequirement.cs @ 441:d2331ee59d74
Re #350: Add requirement to allow N of unit for specific other units
* Add factory for requirement
* Add extra method that assumes "allow N unit for every 1 unit"
* Update/fix documentation
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 03 Dec 2011 16:55:24 +0000 |
parents | baa34d91031f |
children | 206a45fdfa9e |
comparison
equal
deleted
inserted
replaced
440:baa34d91031f | 441:d2331ee59d74 |
---|---|
196 /// The unit type to require. | 196 /// The unit type to require. |
197 /// </param> | 197 /// </param> |
198 /// <param name='minCount'> | 198 /// <param name='minCount'> |
199 /// The minimum number of that type that must exist. | 199 /// The minimum number of that type that must exist. |
200 /// </param> | 200 /// </param> |
201 /// <param name='allowedCount'> | |
202 /// The number of units allowed for every minCount units of the supplied unit type. | |
203 /// </param> | |
201 public void AddUnitTypeRequirement(UnitType unitType, int minCount, int allowedCount) | 204 public void AddUnitTypeRequirement(UnitType unitType, int minCount, int allowedCount) |
202 { | 205 { |
203 requiredTypes.Add(new UnitCountRequirementData(unitType, minCount, allowedCount)); | 206 requiredTypes.Add(new UnitCountRequirementData(unitType, minCount, allowedCount)); |
207 } | |
208 | |
209 /// <summary> | |
210 /// Adds a requirement for there to be at least one of a given UnitType, allowing allowedCount of this UnitType | |
211 /// </summary> | |
212 /// <param name='unitType'> | |
213 /// The unit type to require. | |
214 /// </param> | |
215 /// <param name='allowedCount'> | |
216 /// The number of units allowed for each unit of the supplied unit type. | |
217 /// </param> | |
218 public void AddUnitTypeRequirement(UnitType unitType, int allowedCount) | |
219 { | |
220 AddUnitTypeRequirement(unitType, 1, allowedCount); | |
204 } | 221 } |
205 | 222 |
206 /// <summary> | 223 /// <summary> |
207 /// Adds a requirement for there to be one or more of a given UnitType, allowing one of this UnitType | 224 /// Adds a requirement for there to be one or more of a given UnitType, allowing one of this UnitType |
208 /// </summary> | 225 /// </summary> |
209 /// <param name='unitType'> | 226 /// <param name='unitType'> |
210 /// The unit type to require. | 227 /// The unit type to require. |
211 /// </param> | 228 /// </param> |
212 public void AddUnitTypeRequirement(UnitType unitType) | 229 public void AddUnitTypeRequirement(UnitType unitType) |
213 { | 230 { |
214 AddUnitTypeRequirement(unitType, 1, 1); | 231 AddUnitTypeRequirement(unitType, 1); |
215 } | 232 } |
216 } | 233 } |
217 } | 234 } |
218 | 235 |