Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison API/Objects/Requirement/RequirementHandler.cs @ 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 | 248df19652f9 |
children |
comparison
equal
deleted
inserted
replaced
493:6b0ca39025ed | 494:4f01fdc3bb41 |
---|---|
61 Validation result = Validation.Passed; | 61 Validation result = Validation.Passed; |
62 failureMessages = new List<string>(); | 62 failureMessages = new List<string>(); |
63 | 63 |
64 foreach (IRequirement requirement in army.GetAddingUnitRequirements(unitType)) | 64 foreach (IRequirement requirement in army.GetAddingUnitRequirements(unitType)) |
65 { | 65 { |
66 if (!Validates.AsOkay(requirement.AllowsAdding(unitType, army))) | 66 if (!Validates.AsOkay(requirement.AllowsAdding(unitType, army, context))) |
67 { | 67 { |
68 result = Validation.Failed; | 68 result = Validation.Failed; |
69 failureMessages.Add(requirement.GetAllowsAddingMessage(unitType, army, context)); | 69 failureMessages.Add(requirement.GetAllowsAddingMessage(unitType, army, context)); |
70 } | 70 } |
71 } | 71 } |