Mercurial > repos > snowblizz-super-API-ideas
diff api/Objects/UnitEquipmentItem.cs @ 82:3ea0ab04352b
* Fix line terminators
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Jun 2009 18:59:49 +0000 |
parents | 284ebe05158c |
children | 46ad6f478203 |
line wrap: on
line diff
--- a/api/Objects/UnitEquipmentItem.cs Wed May 27 19:43:09 2009 +0000 +++ b/api/Objects/UnitEquipmentItem.cs Sat Jun 27 18:59:49 2009 +0000 @@ -2,18 +2,18 @@ // // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. -using System; +using System; using System.Xml; -using IBBoard.Lang; - -namespace IBBoard.WarFoundry.API.Objects -{ - /// <summary> - /// Summary description for UnitEquipmentItem. - /// </summary> - public class UnitEquipmentItem : WarFoundryObject +using IBBoard.Lang; + +namespace IBBoard.WarFoundry.API.Objects +{ + /// <summary> + /// Summary description for UnitEquipmentItem. + /// </summary> + public class UnitEquipmentItem : WarFoundryObject { - private EquipmentItem item; + private EquipmentItem item; private bool required; private bool roundUp; private int minNum; @@ -21,9 +21,9 @@ private double minPercentage; private double maxPercentage; private double costMultiplier; - private RoundType roundType; - private string mutexGroup; - private UnitType unitType; + private RoundType roundType; + private string mutexGroup; + private UnitType unitType; protected UnitEquipmentItem(EquipmentItem equipmentItem, UnitType equipForType) { @@ -44,14 +44,14 @@ public string EquipmentItemID { get { return item.ID; } - } - - public double Cost - { + } + + public double Cost + { get { return IBBMath.Round(EquipmentItem.Cost * CostMultiplier, CostRoundType); - } + } } public double CostMultiplier @@ -70,36 +70,36 @@ { roundType = value; } - } - - public bool IsRequired - { - get { return required; } - set { required = value; } - } - - public bool RoundNumberUp - { - get { return roundUp; } - set { roundUp = value; } - } - - public string MutexGroup - { - get { return mutexGroup; } - set { mutexGroup = (value == null ? "" : value.Trim()); } - } - - public UnitType EquipmentForUnit - { - get { return unitType; } - set - { - if (value != null) - { - unitType = value; - } - } + } + + public bool IsRequired + { + get { return required; } + set { required = value; } + } + + public bool RoundNumberUp + { + get { return roundUp; } + set { roundUp = value; } + } + + public string MutexGroup + { + get { return mutexGroup; } + set { mutexGroup = (value == null ? "" : value.Trim()); } + } + + public UnitType EquipmentForUnit + { + get { return unitType; } + set + { + if (value != null) + { + unitType = value; + } + } } public bool IsRatioLimit @@ -157,29 +157,29 @@ } //TODO: Check Min<Max } - } - - public EquipmentItem EquipmentItem - { - get { return item; } - } - - public override string ToString() - { - return EquipmentItem.Name+ " ("+EquipmentItem.Cost+"pts each)"; - } - - public bool HasAlternatives() - { - if (MutexGroup=="") - { - return false; - } - else - { - //If the number of items in the MutEx group is greater than one then it must be this item plus another - return EquipmentForUnit.GetEquipmentItemsByExclusionGroup(MutexGroup).Length > 1; - } + } + + public EquipmentItem EquipmentItem + { + get { return item; } + } + + public override string ToString() + { + return EquipmentItem.Name+ " ("+EquipmentItem.Cost+"pts each)"; + } + + public bool HasAlternatives() + { + if (MutexGroup=="") + { + return false; + } + else + { + //If the number of items in the MutEx group is greater than one then it must be this item plus another + return EquipmentForUnit.GetEquipmentItemsByExclusionGroup(MutexGroup).Length > 1; + } } public ArmourType ItemArmourType @@ -224,6 +224,6 @@ return amount.ToString(); } } - } - } -} + } + } +}