changeset 480:e0641e0eb86c

Re #410: "N units per M models in parent" requirement * Move context to a sub-folder/namespace to reduce clutter * Add simple "parent unit" context
author IBBoard <dev@ibboard.co.uk>
date Wed, 23 May 2012 21:00:33 +0100
parents f48c49b53738
children 81f32062c9fa
files API/Objects/Requirement/AbstractUnitRequirement.cs API/Objects/Requirement/AddingContext.cs API/Objects/Requirement/Context/AddingContext.cs API/Objects/Requirement/Context/AddingToParentContext.cs API/Objects/Requirement/RaceRequiresAtLeastNUnitsRequirement.cs API/Objects/Requirement/RaceRequiresNoMoreThanNUnitsRequirement.cs API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs IBBoard.WarFoundry.API.csproj
diffstat 13 files changed, 48 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/API/Objects/Requirement/AbstractUnitRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/AbstractUnitRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -3,6 +3,7 @@
 // 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.
 using System;
 using System.Collections.Generic;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/AddingContext.cs	Wed May 23 20:56:27 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-// This file (AbstractRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard
-// 
-// 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.
-using System;
-using System.Collections.Generic;
-
-namespace IBBoard.WarFoundry.API.Objects.Requirement
-{
-	/// <summary>
-	/// Marker interface (for now) of useful context information for the AllowsAdding method call.
-	/// </summary>
-	public interface AddingContext
-	{
-
-	}
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/API/Objects/Requirement/Context/AddingContext.cs	Wed May 23 21:00:33 2012 +0100
@@ -0,0 +1,17 @@
+// This file (AbstractRequirement.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard
+// 
+// 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.
+using System;
+using System.Collections.Generic;
+
+namespace IBBoard.WarFoundry.API.Objects.Requirement.Context
+{
+	/// <summary>
+	/// Marker interface (for now) of useful context information for the AllowsAdding method call.
+	/// </summary>
+	public interface AddingContext
+	{
+
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/API/Objects/Requirement/Context/AddingToParentContext.cs	Wed May 23 21:00:33 2012 +0100
@@ -0,0 +1,17 @@
+// This file (AddingToParentContext.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2012 IBBoard
+// 
+// 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.
+using System;
+namespace IBBoard.WarFoundry.API.Objects.Requirement.Context
+{
+	public class AddingToParentContext : AddingContext
+	{
+		public AddingToParentContext(Unit parentUnit)
+		{
+			ParentUnit = parentUnit;
+		}
+
+		public Unit ParentUnit { get; set; }
+	}
+}
+
--- a/API/Objects/Requirement/RaceRequiresAtLeastNUnitsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/RaceRequiresAtLeastNUnitsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -3,6 +3,7 @@
 // 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.
 using System;
 using IBBoard.Collections;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/RaceRequiresNoMoreThanNUnitsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/RaceRequiresNoMoreThanNUnitsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -3,6 +3,7 @@
 // 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.
 using System;
 using IBBoard.Collections;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -5,6 +5,7 @@
 using System.Collections.Generic;
 using IBBoard.WarFoundry.API.Objects;
 using System.Text;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -5,6 +5,7 @@
 using IBBoard.WarFoundry.API.Objects;
 using System.Collections.Generic;
 using System.Text;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs	Wed May 23 20:56:27 2012 +0100
+++ b/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs	Wed May 23 21:00:33 2012 +0100
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Objects.Requirement.Context;
 
 namespace IBBoard.WarFoundry.API.Objects.Requirement
 {
--- a/IBBoard.WarFoundry.API.csproj	Wed May 23 20:56:27 2012 +0100
+++ b/IBBoard.WarFoundry.API.csproj	Wed May 23 21:00:33 2012 +0100
@@ -196,7 +196,8 @@
     <Compile Include="API\Objects\Requirement\AbstractUnitRequirement.cs" />
     <Compile Include="API\Objects\Requirement\RaceRequiresAtLeastNUnitsRequirement.cs" />
     <Compile Include="API\Objects\Requirement\RaceRequiresNoMoreThanNUnitsRequirement.cs" />
-    <Compile Include="API\Objects\Requirement\AddingContext.cs" />
+    <Compile Include="API\Objects\Requirement\Context\AddingContext.cs" />
+    <Compile Include="API\Objects\Requirement\Context\AddingToParentContext.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System.Xml" />
@@ -230,4 +231,7 @@
     </MonoDevelop>
     <VisualStudio />
   </ProjectExtensions>
+  <ItemGroup>
+    <Folder Include="API\Objects\Requirement\Context\" />
+  </ItemGroup>
 </Project>
\ No newline at end of file