comparison API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.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
30 } 30 }
31 } 31 }
32 32
33 protected override bool TypeEquals(object obj) 33 protected override bool TypeEquals(object obj)
34 { 34 {
35 RequiresAtLeastNUnitsRequirement<OBJECT_TYPE> otherReq = (RequiresAtLeastNUnitsRequirement<OBJECT_TYPE>)obj; 35 RequiresAtLeastNUnitsRequirement<OBJECT_TYPE> otherReq = obj as RequiresAtLeastNUnitsRequirement<OBJECT_TYPE>;
36 if (!Collections.Collections.AreEqual(RequiredTypes, otherReq.RequiredTypes)) 36 if (!Collections.Collections.AreEqual(RequiredTypes, otherReq.RequiredTypes))
37 { 37 {
38 return false; 38 return false;
39 } 39 }
40 else 40 else