Mercurial > repos > IBBoard.WarFoundry.API
changeset 494:4f01fdc3bb41
Re #410: Create "N units per M models in parent unit" requirement
* Make sure that adding context is in at the top level and propagated through requirement handling
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 06 Aug 2012 20:50:59 +0100 |
parents | 6b0ca39025ed |
children | 55b39514cbf8 |
files | API/Objects/Requirement/IRequirement.cs API/Objects/Requirement/RequirementHandler.cs |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/API/Objects/Requirement/IRequirement.cs Mon Aug 06 20:44:26 2012 +0100 +++ b/API/Objects/Requirement/IRequirement.cs Mon Aug 06 20:50:59 2012 +0100 @@ -32,7 +32,7 @@ /// <param name='toArmy'> /// The army to add the object to. /// </param> - Validation AllowsAdding(IWarFoundryObject wfObject, Army toArmy); + Validation AllowsAdding(IWarFoundryObject wfObject, Army toArmy, AddingContext context); /// <summary> /// Checks whether the supplied army is currently valid according to this requirement.
--- a/API/Objects/Requirement/RequirementHandler.cs Mon Aug 06 20:44:26 2012 +0100 +++ b/API/Objects/Requirement/RequirementHandler.cs Mon Aug 06 20:50:59 2012 +0100 @@ -63,7 +63,7 @@ foreach (IRequirement requirement in army.GetAddingUnitRequirements(unitType)) { - if (!Validates.AsOkay(requirement.AllowsAdding(unitType, army))) + if (!Validates.AsOkay(requirement.AllowsAdding(unitType, army, context))) { result = Validation.Failed; failureMessages.Add(requirement.GetAllowsAddingMessage(unitType, army, context));