Mercurial > repos > IBBoard.WarFoundry.API
comparison API/Objects/Requirement/RaceRequiresNoMoreThanNUnitsRequirement.cs @ 479:f48c49b53738
Re #410: "N units per M models in parent" requirement
* Add a "context" object that will hold the parent unit (or possibly other stuff)
* Update all method signatures and calls
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 23 May 2012 20:56:27 +0100 |
parents | 025319b6fa7a |
children | e0641e0eb86c |
comparison
equal
deleted
inserted
replaced
478:e4e2a85604b6 | 479:f48c49b53738 |
---|---|
18 protected override int GetObjectCountFromArmy(Army toArmy, Race obj) | 18 protected override int GetObjectCountFromArmy(Army toArmy, Race obj) |
19 { | 19 { |
20 return toArmy.Race == AllowedObject ? 1 : 0; | 20 return toArmy.Race == AllowedObject ? 1 : 0; |
21 } | 21 } |
22 | 22 |
23 protected override bool IsApplicable(Army toArmy) | 23 protected override bool IsApplicable(Army toArmy, AddingContext context) |
24 { | 24 { |
25 bool isApplicable = false; | 25 bool isApplicable = false; |
26 SimpleSet<UnitType> checkedTypes = new SimpleSet<UnitType>(); | 26 SimpleSet<UnitType> checkedTypes = new SimpleSet<UnitType>(); |
27 | 27 |
28 foreach (UnitCountRequirementData limit in ConstraintTypes) | 28 foreach (UnitCountRequirementData limit in ConstraintTypes) |