comparison API/Objects/Requirement/UnitRequiresNParentModelsForMUnitsRequirement.cs @ 488:c082a312a741

Re #410: Create "N units per M models in parent unit" requirement * Tweak validation failure message for more likely case of multiple children
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Jul 2012 14:16:14 +0100
parents 248df19652f9
children aac77204ae0e
comparison
equal deleted inserted replaced
487:248df19652f9 488:c082a312a741
106 106
107 private string GetFailedAddingRequirementsString(UnitType unitType, Unit parentUnit, Army toArmy) 107 private string GetFailedAddingRequirementsString(UnitType unitType, Unit parentUnit, Army toArmy)
108 { 108 {
109 int allowedTypeCount = GetChildCountFromUnit(parentUnit); 109 int allowedTypeCount = GetChildCountFromUnit(parentUnit);
110 110
111 return String.Format("Army can only contain {0} × {1} as a sub-unit of each {2}, would have {3}", allowedTypeCount, unitType.Name, parentUnit.UnitType.Name, (allowedTypeCount + 1)); 111 return String.Format("Army can only contain {0} × {1} as sub-units of each {2}, would have {3}", allowedTypeCount, unitType.Name, parentUnit.UnitType.Name, (allowedTypeCount + 1));
112 } 112 }
113 113
114 protected override string AllowsAddingFailedMessage 114 protected override string AllowsAddingFailedMessage
115 { 115 {
116 get 116 get