comparison API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs @ 454:def5d333c5e8

Re #379: Fix validation of requirements to check for unit * Remove custom messages for overrides to reduce verbosity * Add missing multiplication signs for readability
author IBBoard <dev@ibboard.co.uk>
date Tue, 31 Jan 2012 20:58:09 +0000
parents dace3b7779ca
children afc6410e4efc
comparison
equal deleted inserted replaced
453:dace3b7779ca 454:def5d333c5e8
48 48
49 protected override bool IsApplicable(WarFoundryObject toObject) 49 protected override bool IsApplicable(WarFoundryObject toObject)
50 { 50 {
51 return requirementOnType.Equals(toObject) || (toObject is Unit && requirementOnType.Equals(((Unit)toObject).UnitType)); 51 return requirementOnType.Equals(toObject) || (toObject is Unit && requirementOnType.Equals(((Unit)toObject).UnitType));
52 } 52 }
53
54 protected override string ValidationFailedMessage
55 {
56 get
57 {
58 return "Army contains " + requirementOnType.Name + " and so cannot contain more than: {0}.";
59 }
60 }
61
62 protected override string AllowsAddingFailedMessage
63 {
64 get
65 {
66 return "Army would contain " + requirementOnType.Name + " and so cannot contain more than: {0}.";
67 }
68 }
69 } 53 }
70 } 54 }
71 55