diff API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs @ 487:248df19652f9

Re #410: Create "N units per M models in parent unit" requirement * Add null adding context * Add initial skeleton of "N units per M models in parent unit" requirement * Update use of context * Standardise some of "is applicable" testing
author IBBoard <dev@ibboard.co.uk>
date Fri, 27 Jul 2012 20:31:12 +0100
parents e0641e0eb86c
children
line wrap: on
line diff
--- a/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs	Sun Jul 15 21:01:47 2012 +0100
+++ b/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs	Fri Jul 27 20:31:12 2012 +0100
@@ -21,17 +21,12 @@
 			//Do nothing
 		}
 
-		protected override bool IsApplicable(IWarFoundryObject toObject, Army toArmy, AddingContext context)
-		{
-			return IsApplicable(toObject, context) || IsApplicableForRequiredType(toObject, toArmy);
-		}
-
 		protected override bool IsApplicable(IWarFoundryObject toObject, AddingContext context)
 		{
 			return AllowedObject.Equals(toObject) || (toObject is Unit && AllowedObject.Equals(((Unit)toObject).UnitType));
 		}
 
-		private bool IsApplicableForRequiredType(IWarFoundryObject toObject, Army toArmy)
+		protected override bool IsApplicableToBoth(IWarFoundryObject toObject, Army toArmy, AddingContext context)
 		{
 			bool isApplicable = false;
 			UnitType addedType = toObject as UnitType;