comparison API/Objects/Requirement/AbstractUnitRequirement.cs @ 456:52baffdd2ab9

Re #379: Fix validation of requirements to check for unit * Default to not being applicable - make requirements say when they are * Fix UnitRequiresNUnitsForMUnitsRequirement to not be applicable when adding unrelated units (even if army itself fails the rule) * Fix type casting issues in equality check
author IBBoard <dev@ibboard.co.uk>
date Sat, 25 Feb 2012 16:35:31 +0000
parents afc6410e4efc
children 8e01c3174cc3
comparison
equal deleted inserted replaced
455:afc6410e4efc 456:52baffdd2ab9
62 return IsApplicable(toArmy) || IsApplicable(toObjectAdded); 62 return IsApplicable(toArmy) || IsApplicable(toObjectAdded);
63 } 63 }
64 64
65 protected virtual bool IsApplicable(Army toArmy) 65 protected virtual bool IsApplicable(Army toArmy)
66 { 66 {
67 return true; 67 return false;
68 } 68 }
69 69
70 protected virtual bool IsApplicable(IWarFoundryObject toObject) 70 protected virtual bool IsApplicable(IWarFoundryObject toObject)
71 { 71 {
72 return true; 72 return false;
73 } 73 }
74 74
75 public string GetValidationMessage(Army army) 75 public string GetValidationMessage(Army army)
76 { 76 {
77 string message = ""; 77 string message = "";