# HG changeset patch # User IBBoard # Date 1337803233 -3600 # Node ID e0641e0eb86c57911f5a635b3e85ad9dbe1bf952 # Parent f48c49b537385c4877f21e1ac1ebaa072302df64 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 diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/AbstractUnitRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/AddingContext.cs --- 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 -{ - /// - /// Marker interface (for now) of useful context information for the AllowsAdding method call. - /// - public interface AddingContext - { - - } -} - diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/Context/AddingContext.cs --- /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 +{ + /// + /// Marker interface (for now) of useful context information for the AllowsAdding method call. + /// + public interface AddingContext + { + + } +} + diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/Context/AddingToParentContext.cs --- /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; } + } +} + diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/RaceRequiresAtLeastNUnitsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/RaceRequiresNoMoreThanNUnitsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/RequiresAtLeastNUnitsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/RequiresNUnitsForMObjectsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirement.cs --- 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 { diff -r f48c49b53738 -r e0641e0eb86c IBBoard.WarFoundry.API.csproj --- 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 @@ - + + @@ -230,4 +231,7 @@ + + + \ No newline at end of file