changeset 365:2fed577a1ea7

Re #27: Unit requirements * Remove old requirements
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 May 2011 19:30:35 +0000
parents 0dd8dbe8afe9
children 4993e6f7c509
files API/Requirements/AbstractArmyRequirement.cs API/Requirements/AbstractFailedRequirement.cs API/Requirements/AbstractRequirement.cs API/Requirements/AbstractUnitRequirement.cs API/Requirements/Delegates.cs API/Requirements/FailedRequirement.cs API/Requirements/FailedUnitRequirement.cs API/Requirements/RequirementAND.cs API/Requirements/RequirementOR.cs API/Requirements/UnitExcludesRequirement.cs API/Requirements/UnitRequirement.cs API/Requirements/UnitRequirementItem.cs API/Requirements/UnitRequirementMaxNumber.cs API/Requirements/UnitRequirementMinNumber.cs API/Requirements/UnitRequiresAtLeastRequirement.cs IBBoard.WarFoundry.API.csproj
diffstat 16 files changed, 0 insertions(+), 680 deletions(-) [+]
line diff
     1.1 --- a/API/Requirements/AbstractArmyRequirement.cs	Sun May 01 19:17:40 2011 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,52 +0,0 @@
     1.4 -// This file (AbstractArmyRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     1.5 -//
     1.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     1.7 -
     1.8 -using System;
     1.9 -using System.Collections.Generic;
    1.10 -using IBBoard.WarFoundry.API.Objects;
    1.11 -
    1.12 -
    1.13 -namespace IBBoard.WarFoundry.API.Requirements
    1.14 -{	
    1.15 -	/// <summary>
    1.16 -	/// Abstract class for any requirement for adding an object to an army, e.g. adding units.
    1.17 -	/// </summary>
    1.18 -	public abstract class AbstractArmyRequirement : AbstractRequirement
    1.19 -	{		
    1.20 -		protected abstract AbstractFailedRequirement CanAddToArmy(Army army);
    1.21 -		protected abstract AbstractFailedRequirement CanRemoveFromArmy(Army army);
    1.22 -		
    1.23 -		public override AbstractFailedRequirement CanAddToWarFoundryObject (WarFoundryObject obj)
    1.24 -		{
    1.25 -			AbstractFailedRequirement fail = null;
    1.26 -			
    1.27 -			if (obj is Army)
    1.28 -			{
    1.29 -				fail = CanAddToArmy((Army)obj);
    1.30 -			}
    1.31 -			else
    1.32 -			{
    1.33 -				fail = new FailedRequirement(this);
    1.34 -			}
    1.35 -			
    1.36 -			return fail;
    1.37 -		}
    1.38 -		
    1.39 -		public override AbstractFailedRequirement CanRemoveFromWarFoundryObject (WarFoundryObject obj)
    1.40 -		{
    1.41 -			AbstractFailedRequirement fail = null;
    1.42 -			
    1.43 -			if (obj is Army)
    1.44 -			{
    1.45 -				fail = CanRemoveFromArmy((Army)obj);
    1.46 -			}
    1.47 -			else
    1.48 -			{
    1.49 -				fail = new FailedRequirement(this);
    1.50 -			}
    1.51 -			
    1.52 -			return fail;
    1.53 -		}
    1.54 -	}
    1.55 -}
     2.1 --- a/API/Requirements/AbstractFailedRequirement.cs	Sun May 01 19:17:40 2011 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,20 +0,0 @@
     2.4 -// This file (AbstractFailedRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     2.5 -//
     2.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     2.7 -
     2.8 -using System;
     2.9 -
    2.10 -namespace IBBoard.WarFoundry.API.Requirements
    2.11 -{
    2.12 -	public abstract class AbstractFailedRequirement
    2.13 -	{	
    2.14 -		protected AbstractRequirement failedReq;
    2.15 -		
    2.16 -		public AbstractFailedRequirement(AbstractRequirement req)
    2.17 -		{
    2.18 -			failedReq = req;
    2.19 -		}
    2.20 -		
    2.21 -		public abstract string Description { get; }
    2.22 -	}
    2.23 -}
     3.1 --- a/API/Requirements/AbstractRequirement.cs	Sun May 01 19:17:40 2011 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,19 +0,0 @@
     3.4 -// This file (AbstractRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     3.5 -//
     3.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     3.7 -
     3.8 -using System;
     3.9 -using IBBoard.WarFoundry.API.Objects;
    3.10 -
    3.11 -namespace IBBoard.WarFoundry.API.Requirements
    3.12 -{	
    3.13 -	/// <summary>
    3.14 -	/// The base class for Requirements. Specific types of abstract requirement should extend this class.
    3.15 -	/// </summary>
    3.16 -	public abstract class AbstractRequirement
    3.17 -	{				
    3.18 -		public abstract string Description { get; }
    3.19 -		public abstract AbstractFailedRequirement CanAddToWarFoundryObject(WarFoundryObject obj);
    3.20 -		public abstract AbstractFailedRequirement CanRemoveFromWarFoundryObject(WarFoundryObject obj);
    3.21 -	}
    3.22 -}
     4.1 --- a/API/Requirements/AbstractUnitRequirement.cs	Sun May 01 19:17:40 2011 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,50 +0,0 @@
     4.4 -// This file (AbstractUnitRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     4.5 -//
     4.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     4.7 -
     4.8 -using System;
     4.9 -using IBBoard.WarFoundry.API.Objects;
    4.10 -
    4.11 -namespace IBBoard.WarFoundry.API.Requirements
    4.12 -{
    4.13 -	/// <summary>
    4.14 -	/// Base abstract class for all requirements related to adding/removing something from a Unit (e.g. adding equipment or abilities)
    4.15 -	/// </summary>
    4.16 -	public abstract class AbstractUnitRequirement : AbstractRequirement
    4.17 -	{		
    4.18 -		protected abstract AbstractFailedRequirement CanAddToUnit(Unit unit);
    4.19 -		protected abstract AbstractFailedRequirement CanRemoveFromUnit(Unit unit);
    4.20 -		
    4.21 -		public override AbstractFailedRequirement CanAddToWarFoundryObject (WarFoundryObject obj)
    4.22 -		{
    4.23 -			AbstractFailedRequirement fail = null;
    4.24 -			
    4.25 -			if (obj is Unit)
    4.26 -			{
    4.27 -				fail = CanAddToUnit((Unit)obj);
    4.28 -			}
    4.29 -			else
    4.30 -			{
    4.31 -				fail = new FailedRequirement(this);
    4.32 -			}
    4.33 -			
    4.34 -			return fail;
    4.35 -		}
    4.36 -		
    4.37 -		public override AbstractFailedRequirement CanRemoveFromWarFoundryObject (WarFoundryObject obj)
    4.38 -		{
    4.39 -			AbstractFailedRequirement fail = null;
    4.40 -			
    4.41 -			if (obj is Unit)
    4.42 -			{
    4.43 -				fail = CanRemoveFromUnit((Unit)obj);
    4.44 -			}
    4.45 -			else
    4.46 -			{
    4.47 -				fail = new FailedRequirement(this);
    4.48 -			}
    4.49 -			
    4.50 -			return fail;
    4.51 -		}
    4.52 -	}
    4.53 -}
     5.1 --- a/API/Requirements/Delegates.cs	Sun May 01 19:17:40 2011 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,11 +0,0 @@
     5.4 -// This file (Delegates.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     5.5 -//
     5.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     5.7 -
     5.8 -using System;
     5.9 -using System.Collections.Generic;
    5.10 -
    5.11 -namespace IBBoard.WarFoundry.API.Requirements
    5.12 -{
    5.13 -	public delegate void FailedUnitRequirementDelegate(List<FailedUnitRequirement> failedRequirements);
    5.14 -}
     6.1 --- a/API/Requirements/FailedRequirement.cs	Sun May 01 19:17:40 2011 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,20 +0,0 @@
     6.4 -// This file (FailedRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     6.5 -//
     6.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     6.7 -
     6.8 -using System;
     6.9 -
    6.10 -namespace IBBoard.WarFoundry.API.Requirements
    6.11 -{
    6.12 -	public class FailedRequirement : AbstractFailedRequirement
    6.13 -	{	
    6.14 -		public FailedRequirement(AbstractRequirement req) : base(req)
    6.15 -		{
    6.16 -		}
    6.17 -		
    6.18 -		public override string Description
    6.19 -		{
    6.20 -			get { return failedReq.Description; }
    6.21 -		}
    6.22 -	}
    6.23 -}
     7.1 --- a/API/Requirements/FailedUnitRequirement.cs	Sun May 01 19:17:40 2011 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,24 +0,0 @@
     7.4 -// This file (FailedUnitRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     7.5 -//
     7.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     7.7 -
     7.8 -using System;
     7.9 -
    7.10 -namespace IBBoard.WarFoundry.API.Requirements
    7.11 -{
    7.12 -	/// <summary>
    7.13 -	/// Summary description for UnitRequirement.
    7.14 -	/// </summary>
    7.15 -	public class FailedUnitRequirement : AbstractFailedRequirement
    7.16 -	{
    7.17 -		public FailedUnitRequirement(UnitRequirement requirement) : base(requirement)
    7.18 -		{
    7.19 -		}
    7.20 -		
    7.21 -		public override string Description
    7.22 -		{
    7.23 -			get { return failedReq.Description; }
    7.24 -		}
    7.25 -
    7.26 -	}
    7.27 -}
     8.1 --- a/API/Requirements/RequirementAND.cs	Sun May 01 19:17:40 2011 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,56 +0,0 @@
     8.4 -// This file (RequirementAND.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     8.5 -//
     8.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     8.7 -
     8.8 -using System;
     8.9 -using System.Collections.Generic;
    8.10 -using IBBoard.Lang;
    8.11 -using IBBoard.WarFoundry.API.Objects;
    8.12 -
    8.13 -namespace IBBoard.WarFoundry.API.Requirements
    8.14 -{
    8.15 -	/// <summary>
    8.16 -	/// Summary description for RequirementAND.
    8.17 -	/// </summary>
    8.18 -	public class RequirementAND : AbstractRequirement
    8.19 -	{
    8.20 -		private static string and = Translation.GetTranslation("requirementAND", "{0} and {1}");
    8.21 -
    8.22 -		private AbstractRequirement reqA, reqB;
    8.23 -
    8.24 -		public RequirementAND(AbstractRequirement requirementA, AbstractRequirement requirementB)
    8.25 -		{
    8.26 -			reqA = requirementA;
    8.27 -			reqB = requirementB;
    8.28 -		}
    8.29 -
    8.30 -		public override AbstractFailedRequirement CanAddToWarFoundryObject(WarFoundryObject obj)
    8.31 -		{	
    8.32 -			FailedRequirement failed = null;
    8.33 -			
    8.34 -			if (reqA.CanAddToWarFoundryObject(obj) !=null || reqB.CanAddToWarFoundryObject(obj)!=null)
    8.35 -			{
    8.36 -				failed = new FailedRequirement(this);
    8.37 -			}
    8.38 -			
    8.39 -			return failed;
    8.40 -		}
    8.41 -
    8.42 -		public override AbstractFailedRequirement CanRemoveFromWarFoundryObject(WarFoundryObject obj)
    8.43 -		{
    8.44 -			FailedRequirement failed = null;
    8.45 -			
    8.46 -			if (reqA.CanRemoveFromWarFoundryObject(obj) !=null || reqB.CanRemoveFromWarFoundryObject(obj)!=null)
    8.47 -			{
    8.48 -				failed = new FailedRequirement(this);
    8.49 -			}
    8.50 -			
    8.51 -			return failed;
    8.52 -		}
    8.53 -
    8.54 -		public override string Description 
    8.55 -		{
    8.56 -			get { return String.Format(and, reqA.Description, reqB.Description); }
    8.57 -		}
    8.58 -	}
    8.59 -}
     9.1 --- a/API/Requirements/RequirementOR.cs	Sun May 01 19:17:40 2011 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,56 +0,0 @@
     9.4 -// This file (RequirementOR.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
     9.5 -//
     9.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     9.7 -
     9.8 -using System;
     9.9 -using System.Collections.Generic;
    9.10 -using IBBoard.Lang;
    9.11 -using IBBoard.WarFoundry.API.Objects;
    9.12 -
    9.13 -namespace IBBoard.WarFoundry.API.Requirements
    9.14 -{
    9.15 -	/// <summary>
    9.16 -	/// Summary description for UnitRequirementOR.
    9.17 -	/// </summary>
    9.18 -	public class RequirementOR : AbstractRequirement
    9.19 -	{
    9.20 -		private static string or = Translation.GetTranslation("requirementOR", "{0} or {1}");
    9.21 -
    9.22 -		private AbstractRequirement reqA, reqB;
    9.23 -
    9.24 -		public RequirementOR(AbstractRequirement requirementA, AbstractRequirement requirementB)
    9.25 -		{
    9.26 -			reqA = requirementA;
    9.27 -			reqB = requirementB;
    9.28 -		}
    9.29 -
    9.30 -		public override AbstractFailedRequirement CanAddToWarFoundryObject(WarFoundryObject obj)
    9.31 -		{		
    9.32 -			FailedRequirement failed = null;
    9.33 -			
    9.34 -			if (reqA.CanAddToWarFoundryObject(obj) !=null && reqB.CanAddToWarFoundryObject(obj)!=null)
    9.35 -			{
    9.36 -				failed = new FailedRequirement(this);
    9.37 -			}
    9.38 -			
    9.39 -			return failed;
    9.40 -		}
    9.41 -
    9.42 -		public override AbstractFailedRequirement CanRemoveFromWarFoundryObject(WarFoundryObject obj)
    9.43 -		{		
    9.44 -			FailedRequirement failed = null;
    9.45 -			
    9.46 -			if (reqA.CanRemoveFromWarFoundryObject(obj)!=null && reqB.CanRemoveFromWarFoundryObject(obj)!=null)
    9.47 -			{
    9.48 -				failed = new FailedRequirement(this);
    9.49 -			}
    9.50 -			
    9.51 -			return failed;
    9.52 -		}
    9.53 -
    9.54 -		public override string Description 
    9.55 -		{
    9.56 -			get { return String.Format(or, reqA.Description, reqB.Description); }
    9.57 -		}
    9.58 -	}
    9.59 -}
    10.1 --- a/API/Requirements/UnitExcludesRequirement.cs	Sun May 01 19:17:40 2011 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,68 +0,0 @@
    10.4 -// This file (UnitExcludesRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    10.5 -//
    10.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    10.7 -
    10.8 -using System;
    10.9 -using System.Collections.Generic;
   10.10 -using System.Text;
   10.11 -using IBBoard.WarFoundry.API.Objects;
   10.12 -using IBBoard.Lang;
   10.13 -
   10.14 -namespace IBBoard.WarFoundry.API.Requirements
   10.15 -{
   10.16 -	/// <summary>
   10.17 -	/// Summary description for UnitExcludesRequirement.
   10.18 -	/// </summary>
   10.19 -	public class UnitExcludesRequirement : UnitRequirement
   10.20 -	{
   10.21 -		private UnitRequirementItem[] excludingTypes;
   10.22 -
   10.23 -		public UnitExcludesRequirement(UnitType type, UnitRequirementItem[] excludingUnitTypes) : base(type)
   10.24 -		{
   10.25 -			excludingTypes = excludingUnitTypes;
   10.26 -		}
   10.27 -
   10.28 -		public override string Description
   10.29 -		{
   10.30 -			get 
   10.31 -			{
   10.32 -				string otherUnits = GetOtherUnitTypeNames();
   10.33 -				return Translation.GetTranslation("requirementUnitExcludesDescription", "{0} can only be taken if none of the following are taken: {1}", unitType.Name, otherUnits);
   10.34 -			}
   10.35 -		}
   10.36 -		
   10.37 -		private string GetOtherUnitTypeNames()
   10.38 -		{
   10.39 -			StringBuilder sb = new StringBuilder();
   10.40 -			
   10.41 -			foreach (UnitRequirementItem req in excludingTypes)
   10.42 -			{
   10.43 -				sb.Append(req.UnitType.Name);
   10.44 -			}
   10.45 -			
   10.46 -			return sb.ToString();
   10.47 -		}
   10.48 -
   10.49 -		protected override AbstractFailedRequirement CanAddToArmy(Army army, UnitType type)
   10.50 -		{		
   10.51 -			FailedUnitRequirement failed = null;
   10.52 -
   10.53 -			for (int i = 0; i<excludingTypes.Length; i++)
   10.54 -			{
   10.55 -				if (army.GetUnitTypeCount(excludingTypes[i].UnitType) > 0)
   10.56 -				{
   10.57 -					failed = new FailedUnitRequirement(this);
   10.58 -					break;
   10.59 -				}
   10.60 -			}
   10.61 -			
   10.62 -			return failed;
   10.63 -		}
   10.64 -
   10.65 -		protected override AbstractFailedRequirement CanRemoveFromArmy(Army army, UnitType type)
   10.66 -		{
   10.67 -			return null;
   10.68 -		}
   10.69 -
   10.70 -	}
   10.71 -}
    11.1 --- a/API/Requirements/UnitRequirement.cs	Sun May 01 19:17:40 2011 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,96 +0,0 @@
    11.4 -// This file (UnitRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    11.5 -//
    11.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    11.7 -
    11.8 -using System;
    11.9 -using System.Collections.Generic;
   11.10 -using IBBoard.WarFoundry.API;
   11.11 -using IBBoard.WarFoundry.API.Objects;
   11.12 -
   11.13 -namespace IBBoard.WarFoundry.API.Requirements
   11.14 -{
   11.15 -	/// <summary>
   11.16 -	/// Summary description for UnitRequirement.
   11.17 -	/// </summary>
   11.18 -	public abstract class UnitRequirement : AbstractArmyRequirement
   11.19 -	{
   11.20 -		protected UnitType unitType;
   11.21 -		
   11.22 -		protected UnitRequirement(UnitType requirementFor)
   11.23 -		{
   11.24 -			unitType = requirementFor;	
   11.25 -		}		
   11.26 -		
   11.27 -		/// <summary>
   11.28 -		/// Checks whether the specified unit type can be added to the specified army. Returns a <see cref="FailedRequirement"> obejct if a unit of that type cannot legally be added, or no failure (null) if it can be added. 
   11.29 -		/// </summary>
   11.30 -		/// <param name="army">
   11.31 -		/// The <see cref="Army"/> that the unit should be checked for adding to
   11.32 -		/// </param>
   11.33 -		/// <param name="type">
   11.34 -		/// The <see cref="UnitType"/> that is being checked.
   11.35 -		/// </param>
   11.36 -		/// <returns>
   11.37 -		/// A <see cref="AbstractFailedRequirement"/> if the requirement means the <see cref="UnitType"/> cannot be legally added, else <code>null</code>.
   11.38 -		/// </returns>
   11.39 -		protected abstract AbstractFailedRequirement CanAddToArmy(Army army, UnitType type);
   11.40 -		
   11.41 -		/// <summary>
   11.42 -		/// Checks whether the specified unit can be added to the specified army. Returns a <see cref="FailedRequirement"> obejct if the unit cannot legally be added, or no failure (null) if it can be added. 
   11.43 -		/// </summary>
   11.44 -		/// <param name="army">
   11.45 -		/// The <see cref="Army"/> that the unit should be checked for adding to
   11.46 -		/// </param>
   11.47 -		/// <param name="type">
   11.48 -		/// The <see cref="Unit"/> that is being checked.
   11.49 -		/// </param>
   11.50 -		/// <returns>
   11.51 -		/// A <see cref="AbstractFailedRequirement"/> if the requirement means the <see cref="Unit"/> cannot be legally added, else <code>null</code>.
   11.52 -		/// </returns>
   11.53 -		protected AbstractFailedRequirement CanAddToArmy(Army army, Unit unit)
   11.54 -		{
   11.55 -			return CanAddToArmy(army, unit.UnitType);
   11.56 -		}
   11.57 -		
   11.58 -		/// <summary>
   11.59 -		/// Checks whether the specified unit type can be removed from the specified army. Returns a <see cref="FailedRequirement"> obejct if a unit of that type cannot legally be removed, or no failure (null) if it can be removed. 
   11.60 -		/// </summary>
   11.61 -		/// <param name="army">
   11.62 -		/// The <see cref="Army"/> that the unit should be checked for adding to
   11.63 -		/// </param>
   11.64 -		/// <param name="type">
   11.65 -		/// The <see cref="UnitType"/> that is being checked.
   11.66 -		/// </param>
   11.67 -		/// <returns>
   11.68 -		/// A <see cref="AbstractFailedRequirement"/> if the requirement means the <see cref="UnitType"/> cannot be legally added, else <code>null</code>.
   11.69 -		/// </returns>
   11.70 -		protected abstract AbstractFailedRequirement CanRemoveFromArmy(Army army, UnitType type);
   11.71 -		
   11.72 -		/// <summary>
   11.73 -		/// Checks whether the specified unit can be removed from the specified army. Returns a <see cref="FailedRequirement"> obejct if the unit cannot legally be removed, or no failure (null) if it can be removed. 
   11.74 -		/// </summary>
   11.75 -		/// <param name="army">
   11.76 -		/// The <see cref="Army"/> that the unit should be checked for adding to
   11.77 -		/// </param>
   11.78 -		/// <param name="type">
   11.79 -		/// The <see cref="Unit"/> that is being checked.
   11.80 -		/// </param>
   11.81 -		/// <returns>
   11.82 -		/// A <see cref="AbstractFailedRequirement"/> if the requirement means the <see cref="Unit"/> cannot be legally removed, else <code>null</code>.
   11.83 -		/// </returns>
   11.84 -		protected AbstractFailedRequirement CanRemoveFromArmy(Army army, Unit unit)
   11.85 -		{
   11.86 -			return CanRemoveFromArmy(army, unit.UnitType);
   11.87 -		}
   11.88 -				
   11.89 -		protected override AbstractFailedRequirement CanAddToArmy(Army army)
   11.90 -		{
   11.91 -			return CanAddToArmy(army, unitType);
   11.92 -		}
   11.93 -		
   11.94 -		protected override AbstractFailedRequirement CanRemoveFromArmy(Army army)
   11.95 -		{
   11.96 -			return CanRemoveFromArmy(army, unitType);
   11.97 -		}
   11.98 -	}
   11.99 -}
    12.1 --- a/API/Requirements/UnitRequirementItem.cs	Sun May 01 19:17:40 2011 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,36 +0,0 @@
    12.4 -// This file (UnitRequirementItem.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    12.5 -//
    12.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    12.7 -
    12.8 -using System;
    12.9 -using IBBoard.WarFoundry.API.Objects;
   12.10 -
   12.11 -namespace IBBoard.WarFoundry.API.Requirements
   12.12 -{
   12.13 -	/// <summary>
   12.14 -	/// Summary description for UnitRequirementItem.
   12.15 -	/// </summary>
   12.16 -	public class UnitRequirementItem
   12.17 -	{
   12.18 -		private UnitType type;
   12.19 -		private int requiredNum;
   12.20 -
   12.21 -		public UnitRequirementItem(UnitType unitType, int reqNumber)
   12.22 -		{
   12.23 -			type = unitType;
   12.24 -			requiredNum = reqNumber;
   12.25 -		}
   12.26 -
   12.27 -		public UnitRequirementItem(UnitType type) : this(type, 1) { }
   12.28 -
   12.29 -		public UnitType UnitType
   12.30 -		{
   12.31 -			get { return type; }
   12.32 -		}
   12.33 -
   12.34 -		public int Amount
   12.35 -		{
   12.36 -			get { return requiredNum; }
   12.37 -		}
   12.38 -	}
   12.39 -}
    13.1 --- a/API/Requirements/UnitRequirementMaxNumber.cs	Sun May 01 19:17:40 2011 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,42 +0,0 @@
    13.4 -// This file (UnitRequirementMaxNumber.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    13.5 -//
    13.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    13.7 -
    13.8 -using System;
    13.9 -using IBBoard.Lang;
   13.10 -using IBBoard.WarFoundry.API.Objects;
   13.11 -
   13.12 -namespace IBBoard.WarFoundry.API.Requirements
   13.13 -{
   13.14 -	public class UnitRequirementMaxNumber : UnitRequirement
   13.15 -	{		
   13.16 -		private int maxUnitCount;
   13.17 -		
   13.18 -		public UnitRequirementMaxNumber(UnitType type, int maxNumber) : base(type)
   13.19 -		{
   13.20 -			maxUnitCount = maxNumber;
   13.21 -		}
   13.22 -		
   13.23 -		public override string Description
   13.24 -		{
   13.25 -			get { return Translation.GetTranslation("requirementUnitMaxNumber", "an army can contain up to {0} units of type {1}", maxUnitCount, unitType.Name); }
   13.26 -		}
   13.27 -		
   13.28 -		protected override AbstractFailedRequirement CanAddToArmy (Army army, UnitType type)
   13.29 -		{
   13.30 -			FailedUnitRequirement failed = null;
   13.31 -			
   13.32 -			if (army.GetUnitTypeCount(type) >= maxUnitCount)
   13.33 -			{
   13.34 -				failed = new FailedUnitRequirement(this);
   13.35 -			}
   13.36 -			
   13.37 -			return failed;
   13.38 -		}
   13.39 -
   13.40 -		protected override AbstractFailedRequirement CanRemoveFromArmy (Army army, UnitType type)
   13.41 -		{
   13.42 -			return null;
   13.43 -		}
   13.44 -	}
   13.45 -}
    14.1 --- a/API/Requirements/UnitRequirementMinNumber.cs	Sun May 01 19:17:40 2011 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,42 +0,0 @@
    14.4 -// This file (UnitRequirementMinNumber.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    14.5 -//
    14.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    14.7 -
    14.8 -using System;
    14.9 -using IBBoard.Lang;
   14.10 -using IBBoard.WarFoundry.API.Objects;
   14.11 -
   14.12 -namespace IBBoard.WarFoundry.API.Requirements
   14.13 -{
   14.14 -	public class UnitRequirementMinNumber : UnitRequirement
   14.15 -	{
   14.16 -		private int minUnitCount;
   14.17 -		
   14.18 -		public UnitRequirementMinNumber(UnitType type, int minNumber) : base(type)
   14.19 -		{
   14.20 -			minUnitCount = minNumber;
   14.21 -		}
   14.22 -		
   14.23 -		public override string Description
   14.24 -		{
   14.25 -			get { return Translation.GetTranslation("requirementUnitMinNumber", "you must include at least {0} of {1} in an army", minUnitCount, unitType.Name); }
   14.26 -		}
   14.27 -		
   14.28 -		protected override AbstractFailedRequirement CanAddToArmy(Army army, UnitType type)
   14.29 -		{
   14.30 -			return null;
   14.31 -		}
   14.32 -
   14.33 -		protected override AbstractFailedRequirement CanRemoveFromArmy (Army army, UnitType type)
   14.34 -		{
   14.35 -			FailedUnitRequirement failed = null;
   14.36 -			
   14.37 -			if (army.GetUnitTypeCount(type) <= minUnitCount)
   14.38 -			{
   14.39 -				failed = new FailedUnitRequirement(this);
   14.40 -			}
   14.41 -			
   14.42 -			return failed;
   14.43 -		}
   14.44 -	}
   14.45 -}
    15.1 --- a/API/Requirements/UnitRequiresAtLeastRequirement.cs	Sun May 01 19:17:40 2011 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,73 +0,0 @@
    15.4 -// This file (UnitRequiresAtLeastRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2008, 2009 IBBoard.
    15.5 -//
    15.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
    15.7 -
    15.8 -using System;
    15.9 -using System.Collections.Generic;
   15.10 -using System.Text;
   15.11 -using IBBoard.Lang;
   15.12 -using IBBoard.WarFoundry.API;
   15.13 -using IBBoard.WarFoundry.API.Objects;
   15.14 -
   15.15 -namespace IBBoard.WarFoundry.API.Requirements
   15.16 -{
   15.17 -	/// <summary>
   15.18 -	/// Summary description for UnitRequiresRequirement.
   15.19 -	/// </summary>
   15.20 -	public class UnitRequiresAtLeastRequirement : UnitRequirement
   15.21 -	{
   15.22 -		private UnitRequirementItem[] requiredTypes;
   15.23 -		private String unitList;
   15.24 -
   15.25 -		public UnitRequiresAtLeastRequirement(UnitType type, UnitType requiredUnitType) : this(type, new UnitRequirementItem[]{new UnitRequirementItem(requiredUnitType)})
   15.26 -		{
   15.27 -		}
   15.28 -		
   15.29 -		public UnitRequiresAtLeastRequirement(UnitType type, UnitRequirementItem[] requiredUnitTypes) : base(type)
   15.30 -		{			
   15.31 -			requiredTypes = requiredUnitTypes;
   15.32 -			bool first = true;
   15.33 -			
   15.34 -			foreach (UnitRequirementItem req in requiredTypes)
   15.35 -			{
   15.36 -				string reqString = Translation.GetTranslation("requirementUnitTypeAtLeastSingle", "{1} {0}", req.UnitType.Name, req.Amount);
   15.37 -				
   15.38 -				if (first)
   15.39 -				{
   15.40 -					first = false;
   15.41 -					unitList = reqString;
   15.42 -				}
   15.43 -				else
   15.44 -				{
   15.45 -					unitList = Translation.GetTranslation("requirementUnitTypeAtLeastJoiner", "{0}, {1}", unitList, reqString);
   15.46 -				}
   15.47 -			}
   15.48 -		}
   15.49 -
   15.50 -		public override string Description
   15.51 -		{
   15.52 -			get { return Translation.GetTranslation("requirementUnitTypeAtLeast", "the army must include at least the following units to include a unit of type {0}: {1}", unitType.Name, unitList); }
   15.53 -		}
   15.54 -
   15.55 -		protected override AbstractFailedRequirement CanRemoveFromArmy(Army army, UnitType type)
   15.56 -		{
   15.57 -			return null;
   15.58 -		}
   15.59 -
   15.60 -		protected override AbstractFailedRequirement CanAddToArmy(Army army, UnitType type)
   15.61 -		{
   15.62 -			FailedRequirement failure = null;
   15.63 -			
   15.64 -			foreach (UnitRequirementItem req in requiredTypes)
   15.65 -			{
   15.66 -				if (army.GetUnitTypeCount(req.UnitType) < req.Amount)
   15.67 -				{				
   15.68 -					failure = new FailedRequirement(this);
   15.69 -					break;
   15.70 -				}
   15.71 -			}
   15.72 -						
   15.73 -			return failure;
   15.74 -		}
   15.75 -	}
   15.76 -}
    16.1 --- a/IBBoard.WarFoundry.API.csproj	Sun May 01 19:17:40 2011 +0000
    16.2 +++ b/IBBoard.WarFoundry.API.csproj	Mon May 02 19:30:35 2011 +0000
    16.3 @@ -137,21 +137,6 @@
    16.4      <Compile Include="API\Objects\UnitType.cs" />
    16.5      <Compile Include="API\Objects\WarFoundryObject.cs" />
    16.6      <Compile Include="API\Objects\WarFoundryStagedLoadingObject.cs" />
    16.7 -    <Compile Include="API\Requirements\AbstractArmyRequirement.cs" />
    16.8 -    <Compile Include="API\Requirements\AbstractFailedRequirement.cs" />
    16.9 -    <Compile Include="API\Requirements\AbstractRequirement.cs" />
   16.10 -    <Compile Include="API\Requirements\AbstractUnitRequirement.cs" />
   16.11 -    <Compile Include="API\Requirements\Delegates.cs" />
   16.12 -    <Compile Include="API\Requirements\FailedRequirement.cs" />
   16.13 -    <Compile Include="API\Requirements\FailedUnitRequirement.cs" />
   16.14 -    <Compile Include="API\Requirements\RequirementAND.cs" />
   16.15 -    <Compile Include="API\Requirements\RequirementOR.cs" />
   16.16 -    <Compile Include="API\Requirements\UnitExcludesRequirement.cs" />
   16.17 -    <Compile Include="API\Requirements\UnitRequirement.cs" />
   16.18 -    <Compile Include="API\Requirements\UnitRequirementItem.cs" />
   16.19 -    <Compile Include="API\Requirements\UnitRequirementMaxNumber.cs" />
   16.20 -    <Compile Include="API\Requirements\UnitRequirementMinNumber.cs" />
   16.21 -    <Compile Include="API\Requirements\UnitRequiresAtLeastRequirement.cs" />
   16.22      <Compile Include="API\Savers\IWarFoundryFileSaver.cs" />
   16.23      <Compile Include="API\Savers\WarFoundrySaver.cs" />
   16.24      <Compile Include="API\Util\UnitEquipmentUtil.cs" />