view API/Objects/Mock/MockPercentageAmountUnitEquipmentItem.cs @ 120:d186d46f0bae

Re #27: Unit requirements * Quick first draft of unit tests for "unit requires no more than X"
author IBBoard <dev@ibboard.co.uk>
date Wed, 06 Apr 2011 20:05:04 +0000
parents e6bf9b5e1b94
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);
		}
	}
}