Mercurial > repos > IBDev-IBBoard.WarFoundry.API
changeset 282:cd082d7bd4d9
Re #60: Add UI to add/remove/edit weapons in GTK
* Add a method to determine whether we can change the equipment amount or not
Also:
* Remove unnecessary library reference
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 04 Sep 2010 10:26:46 +0000 |
parents | c035afa4a42c |
children | cd657faa0c05 |
files | IBBoard.WarFoundry.API.csproj api/Util/UnitEquipmentUtil.cs |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/IBBoard.WarFoundry.API.csproj Sat Jul 31 15:26:53 2010 +0000 +++ b/IBBoard.WarFoundry.API.csproj Sat Sep 04 10:26:46 2010 +0000 @@ -168,7 +168,6 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <Reference Include="System.Data" /> <Reference Include="System.Xml" /> <Reference Include="System" /> <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73">
--- a/api/Util/UnitEquipmentUtil.cs Sat Jul 31 15:26:53 2010 +0000 +++ b/api/Util/UnitEquipmentUtil.cs Sat Sep 04 10:26:46 2010 +0000 @@ -202,5 +202,10 @@ AbstractUnitEquipmentItemSelection selection = unit.GetEquipmentSelection(item); return (selection == null ? 0 : selection.NumberTaken); } + + public static bool CanEditEquipmentAmount(Unit unit, UnitEquipmentItem item) + { + return item !=null && (item.MaxLimit.GetLimit(unit.Size) != item.MinLimit.GetLimit(unit.Size)); + } } }