Mercurial > repos > IBDev-IBBoard.WarFoundry.API
diff API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.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 | f0594621e4a0 |
children | e0641e0eb86c |
line wrap: on
line diff
--- a/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs Wed May 23 20:37:23 2012 +0100 +++ b/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs Wed May 23 20:56:27 2012 +0100 @@ -17,12 +17,12 @@ //Do nothing special } - protected override bool IsApplicable(IWarFoundryObject toObject, Army toArmy) + protected override bool IsApplicable(IWarFoundryObject toObject, Army toArmy, AddingContext context) { - return base.IsApplicable(toObject, toArmy) || IsApplicableForRequiredType(toObject, toArmy); + return base.IsApplicable(toObject, toArmy, context) || IsApplicableForRequiredType(toObject, toArmy); } - protected override bool IsApplicable(IWarFoundryObject toObject) + protected override bool IsApplicable(IWarFoundryObject toObject, AddingContext context) { return AllowedObject.Equals(toObject) || (toObject is Unit && AllowedObject.Equals(((Unit)toObject).UnitType)); }