Mercurial > repos > snowblizz-super-API-ideas
changeset 326:331995582990
Re #27: Define unit requirements
* First skeleton of first new style requirement
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 26 Mar 2011 17:03:00 +0000 |
parents | e0580a009e75 |
children | 1c32b8a1600e |
files | IBBoard.WarFoundry.API.csproj api/Objects/UnitRequiresAtLeastNUnitsRequirement.cs |
diffstat | 2 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/IBBoard.WarFoundry.API.csproj Sat Mar 12 20:32:08 2011 +0000 +++ b/IBBoard.WarFoundry.API.csproj Sat Mar 26 17:03:00 2011 +0000 @@ -185,6 +185,7 @@ <Compile Include="api\Savers\Xml\WarFoundryXmlArmySaver.cs" /> <Compile Include="api\Savers\Xml\WarFoundryXmlGameSystemSaver.cs" /> <Compile Include="api\Savers\Xml\WarFoundryXmlFileSaver.cs" /> + <Compile Include="api\Objects\UnitRequiresAtLeastNUnitsRequirement.cs" /> </ItemGroup> <ItemGroup> <Reference Include="System.Xml" />
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Objects/UnitRequiresAtLeastNUnitsRequirement.cs Sat Mar 26 17:03:00 2011 +0000 @@ -0,0 +1,28 @@ +// This file (UnitRequiresAtLeastNUnitsRequirement.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; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.API.Objects +{ + /// <summary> + /// A requirement where a Unit requires at least N units of one or more unit types before it can be taken. + /// </summary> + public class UnitRequiresAtLeastNUnitsRequirement + { + private List<UnitType> requiredTypes; + + public UnitRequiresAtLeastNUnitsRequirement(params UnitType[] requiredUnitTypes) + { + requiredTypes = new List<UnitType>(requiredUnitTypes); + } + + public bool CanAddToArmy(Unit unit, Army army) + { + return false; + } + } +} +