view Util/UnitEquipmentChoice.cs @ 32:e97867236672

Re #112: WinForms UI won't build on other machines * Use HOMEDRIVE and HOMEPATH variables to construct a path that should be in a user-writable area for everyone and isn't on a mapped network drive for IBBoard. Seems to work, but needs confirmation from others
author IBBoard <dev@ibboard.co.uk>
date Tue, 04 Aug 2009 19:40:20 +0000
parents 7c366fe55635
children 3ceb0efd261f
line wrap: on
line source

// This file (UnitEquipmentChoice.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 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.Collections;
using IBBoard.WarFoundry.API.Objects;



namespace IBBoard.WarFoundry.GUI.WinForms.Util
{
    /// <summary>
    /// A helper object that holds an equipment choice for a unit.
    /// </summary>

    public class UnitEquipmentChoice
    {
        private Unit unit;
		private UnitEquipmentItem item;

        private static Hashtable equipObjs = new Hashtable();

        public UnitEquipmentChoice(Unit unit, UnitEquipmentItem unitItem)
        {
            this.unit = unit;
            item = unitItem;
        }

        public override string ToString()
        {
            return String.Format("{0} (For {1} at {2}pts each)", item.Name, UnitEquipmentItem.FormatEquipmentAmount(item, unit.GetEquipmentAmount(item)), item.Cost);
        }

        public UnitEquipmentItem Item
        {
            get { return item; }
        }
    }
}