# HG changeset patch # User IBBoard # Date 1328043489 0 # Node ID def5d333c5e82daaf27406a4ef363c9d2f59d400 # Parent dace3b7779cab56e2e5b6241eb27185ea6f2dbf6 Re #379: Fix validation of requirements to check for unit * Remove custom messages for overrides to reduce verbosity * Add missing multiplication signs for readability diff -r dace3b7779ca -r def5d333c5e8 API/Objects/Requirement/RequiresNUnitsForMUnitsRequirement.cs --- a/API/Objects/Requirement/RequiresNUnitsForMUnitsRequirement.cs Sun Jan 29 20:05:25 2012 +0000 +++ b/API/Objects/Requirement/RequiresNUnitsForMUnitsRequirement.cs Tue Jan 31 20:58:09 2012 +0000 @@ -66,7 +66,7 @@ if (!IsValidByRequirement(unitType, toArmy, limit, allowedTypeCount)) { string unitTypeList = GetUnitTypeList(limit); - failures.Add(String.Format("{0} {1} for every {2} {3} (would have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); + failures.Add(String.Format("{0} × {1} for every {2} × {3} (would have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); } } @@ -190,7 +190,7 @@ if (!IsValidByRequirement(limit, allowedTypeCount, limitedTypeCount)) { string unitTypeList = GetUnitTypeList(limit); - failures.Add(String.Format("{0} {1} for every {2} {3} (have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); + failures.Add(String.Format("{0} × {1} for every {2} × {3} (have {4} for {5})", limit.Count, unitTypeList, limit.AllowsCount, allowedType.Name, limitedTypeCount, allowedTypeCount)); } } diff -r dace3b7779ca -r def5d333c5e8 API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs --- a/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs Sun Jan 29 20:05:25 2012 +0000 +++ b/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs Tue Jan 31 20:58:09 2012 +0000 @@ -38,22 +38,6 @@ { return IsApplicable(toArmy) ? base.ValidatesArmy(toArmy) : Validation.NotApplicable; } - - protected override string ValidationFailedMessage - { - get - { - return "Army contains " + requirementOnType.Name + " and so must contain: {0}."; - } - } - - protected override string AllowsAddingFailedMessage - { - get - { - return "Army would contain " + requirementOnType.Name + " and so must contain: {0}."; - } - } } } diff -r dace3b7779ca -r def5d333c5e8 API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs --- a/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs Sun Jan 29 20:05:25 2012 +0000 +++ b/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs Tue Jan 31 20:58:09 2012 +0000 @@ -50,22 +50,6 @@ { return requirementOnType.Equals(toObject) || (toObject is Unit && requirementOnType.Equals(((Unit)toObject).UnitType)); } - - protected override string ValidationFailedMessage - { - get - { - return "Army contains " + requirementOnType.Name + " and so cannot contain more than: {0}."; - } - } - - protected override string AllowsAddingFailedMessage - { - get - { - return "Army would contain " + requirementOnType.Name + " and so cannot contain more than: {0}."; - } - } } }