# HG changeset patch # User IBBoard # Date 1254843844 0 # Node ID 8e7bbea333d872542c71d9b4a67bfb36fbefc7c0 # Parent 9ba56a8e5096322b6dbbc1d73d657791d09b39c4 Re #198: Add slots with counts to units * Add starts of updated API and updated DTD to handle both numeric and ratio limits diff -r 9ba56a8e5096 -r 8e7bbea333d8 IBBoard.WarFoundry.API.csproj --- a/IBBoard.WarFoundry.API.csproj Tue Oct 06 14:59:54 2009 +0000 +++ b/IBBoard.WarFoundry.API.csproj Tue Oct 06 15:44:04 2009 +0000 @@ -95,6 +95,9 @@ + + + @@ -108,6 +111,7 @@ + diff -r 9ba56a8e5096 -r 8e7bbea333d8 api/Objects/AbstractUnitEquipmentSlot.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Objects/AbstractUnitEquipmentSlot.cs Tue Oct 06 15:44:04 2009 +0000 @@ -0,0 +1,41 @@ +// This file (UnitEquipmentSlot.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 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 System.Text; + +namespace IBBoard.WarFoundry.API.Objects +{ + /// + /// An abstract base implementation of an equipment slot for a unit + /// + public abstract class AbstractUnitEquipmentSlot + { + private string name; + private double limit; + + public AbstractUnitEquipmentSlot(string slotName, double slotLimit) + { + name = slotName; + limit = slotLimit; + } + + public string Name + { + get + { + return name; + } + } + + public double Limit + { + get + { + return limit; + } + } + } +} diff -r 9ba56a8e5096 -r 8e7bbea333d8 api/Objects/DefaultUnitEquipmentSlot.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Objects/DefaultUnitEquipmentSlot.cs Tue Oct 06 15:44:04 2009 +0000 @@ -0,0 +1,17 @@ +// This file (DefaultUnitEquipmentSlot.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 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 System.Text; + +namespace IBBoard.WarFoundry.API.Objects +{ + public class DefaultUnitEquipmentSlot : AbstractUnitEquipmentSlot + { + public DefaultUnitEquipmentSlot() : base("", WarFoundryCore.INFINITY) + { + } + } +} diff -r 9ba56a8e5096 -r 8e7bbea333d8 api/Objects/NumericLimitUnitEquipmentSlot.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Objects/NumericLimitUnitEquipmentSlot.cs Tue Oct 06 15:44:04 2009 +0000 @@ -0,0 +1,18 @@ +// This file (NumericLimitUnitEquipmentSlot.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 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 System.Text; + +namespace IBBoard.WarFoundry.API.Objects +{ + public class NumericLimitUnitEquipmentSlot : AbstractUnitEquipmentSlot + { + public NumericLimitUnitEquipmentSlot(string slotName, int ratioLimit) + : base("", ratioLimit) + { + } + } +} diff -r 9ba56a8e5096 -r 8e7bbea333d8 api/Objects/RatioLimitUnitEquipmentSlot.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Objects/RatioLimitUnitEquipmentSlot.cs Tue Oct 06 15:44:04 2009 +0000 @@ -0,0 +1,24 @@ +// This file (RatioLimitUnitEquipmentSlot.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 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 IBBoard.Lang; + +namespace IBBoard.WarFoundry.API.Objects +{ + public class RatioLimitUnitEquipmentSlot : AbstractUnitEquipmentSlot + { + private RoundType roundDir; + + public RatioLimitUnitEquipmentSlot(string slotName, double ratioLimit, RoundType roundDirection) : base(slotName, ratioLimit) + { + roundDir = roundDirection; + } + + public RoundType RoundType + { + get { return roundDir; } + } + } +} diff -r 9ba56a8e5096 -r 8e7bbea333d8 dtds/race.xsd --- a/dtds/race.xsd Tue Oct 06 14:59:54 2009 +0000 +++ b/dtds/race.xsd Tue Oct 06 15:44:04 2009 +0000 @@ -36,7 +36,8 @@ - + +