view API/Objects/Mock/MockPercentageAmountUnitEquipmentItem.cs @ 26:e6bf9b5e1b94

Re #198: Add equipment slots * Alter constructors of mock percentage unit equipment items for more flexibility * Consolidate tests * Add full set of tests for getting max percentage * Add extra tests to handle different limits
author IBBoard <dev@ibboard.co.uk>
date Wed, 28 Oct 2009 20:43:33 +0000
parents d48e73488838
children
line wrap: on
line source

// This file (MockUnitEquipmentItem.cs) is a part of the IBBoard.WarFoundry.API.Tests 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 IBBoard.Limits;
using IBBoard.WarFoundry.API.Objects;

namespace IBBoard.WarFoundry.API.Objects.Mock
{
	public class MockPercentageAmountUnitEquipmentItem : UnitEquipmentItem
	{
		public MockPercentageAmountUnitEquipmentItem () : this(new MockEquipmentItem(), new MockUnitType())
		{
		}
		
		public MockPercentageAmountUnitEquipmentItem(double percentage) : this(percentage, percentage)
		{
		}
		
		public MockPercentageAmountUnitEquipmentItem(double min, double max) : this(new MockEquipmentItem(), new MockUnitType(), min, max)
		{
		}
		
		public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type) : this(item, type, 50, 50)
		{
		}
		
		public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type, double min, double max) : base(item, type)
		{
			MinLimit = new SimpleRoundedPercentageLimit(min, false);
			MaxLimit = new SimpleRoundedPercentageLimit(max, false);
		}
	}
}