annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (MockUnitEquipmentItem.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2009 IBBoard
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 // 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.
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
6 using IBBoard.Limits;
16
74346d5c17fe Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
7 using IBBoard.WarFoundry.API.Objects;
15
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 namespace IBBoard.WarFoundry.API.Objects.Mock
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 {
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 public class MockPercentageAmountUnitEquipmentItem : UnitEquipmentItem
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 {
16
74346d5c17fe Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
13 public MockPercentageAmountUnitEquipmentItem () : this(new MockEquipmentItem(), new MockUnitType())
74346d5c17fe Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
14 {
74346d5c17fe Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
15 }
74346d5c17fe Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
16
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
17 public MockPercentageAmountUnitEquipmentItem(double percentage) : this(percentage, percentage)
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
18 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
19 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
20
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
21 public MockPercentageAmountUnitEquipmentItem(double min, double max) : this(new MockEquipmentItem(), new MockUnitType(), min, max)
25
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
22 {
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
23 }
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
24
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
25 public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type) : this(item, type, 50, 50)
15
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 {
25
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
27 }
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
28
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
29 public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type, double min, double max) : base(item, type)
25
d48e73488838 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
30 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
31 MinLimit = new SimpleRoundedPercentageLimit(min, false);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
32 MaxLimit = new SimpleRoundedPercentageLimit(max, false);
15
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 }
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 }
1119b6f48e8e Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 }