diff API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs @ 427:3882b533d99d

Re #27: Define unit requirements * Add ID to requirements so that it isn't just defined in factories * Make factory use ID from requirement class to avoid duplication and possible mismatch
author IBBoard <dev@ibboard.co.uk>
date Sun, 30 Oct 2011 20:31:43 +0000
parents 71fceea2725b
children b671085871b7
line wrap: on
line diff
--- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs	Fri Oct 28 20:52:29 2011 +0100
+++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs	Sun Oct 30 20:31:43 2011 +0000
@@ -9,10 +9,13 @@
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
 	/// <summary>
-	/// A requirement where a WarFoundryObject requires at least N units of one or more unit types before any number of that object can be taken in an army.
+	/// A requirement where a WarFoundryObject requires at least N units of any of the specified unit types before any number of that object can be taken in an army.
+	///
+	/// The definition for how this requirement is built from a data file is defined in the <see cref="UnitRequiresAtLeastNUnitsRequirementFactory"/> class.
 	/// </summary>
 	public class RequiresAtLeastNUnitsRequirement : AbstractRequirement
 	{
+		public static readonly string REQUIREMENT_ID = "RequiresAtLeastNUnits";
 		private List<UnitCountRequirementData> requiredTypes;
 
 		public RequiresAtLeastNUnitsRequirement(params UnitType[] requiredUnitTypes)
@@ -26,6 +29,15 @@
 			}
 		}
 
+
+		public override string RequirementID
+		{
+			get
+			{
+				return REQUIREMENT_ID;
+			}
+		}
+
 		protected override bool TypeEquals (object obj)
 		{
 			RequiresAtLeastNUnitsRequirement otherReq = (RequiresAtLeastNUnitsRequirement)obj;