Mercurial > repos > IBBoard.WarFoundry.API
annotate api/Commands/AbstractSetUnitEquipmentAmountCommand.cs @ 214:1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
* Fix locations in the API that are used in the front-end
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Nov 2009 21:27:07 +0000 |
parents | 2f3cafb69799 |
children | 391446c9b250 |
rev | line source |
---|---|
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (AbstractSetUnitEquipmentAmountCommand.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard |
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
101
diff
changeset
|
2 // |
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
101
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. |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using IBBoard.Commands; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 using IBBoard.Lang; |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
8 using IBBoard.WarFoundry.API.Objects; |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
9 using IBBoard.WarFoundry.API.Util; |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 namespace IBBoard.WarFoundry.API.Commands |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 /// <summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 /// Abstract parent class for commands that set the amount of an equipment item a unit has to a fixed numeric or ratio value |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 /// </summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 public abstract class AbstractSetUnitEquipmentAmountCommand : Command |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 private Unit unit; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 private UnitEquipmentItem equip; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 private double oldAmount; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 private bool oldAmountWasRatio; |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
22 private string equipName; |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
23 private string unitName; |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 public AbstractSetUnitEquipmentAmountCommand(Unit unit, UnitEquipmentItem item) |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 this.unit = unit; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 equip = item; |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
29 oldAmount = UnitEquipmentUtil.GetEquipmentAmount(unit, equip); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
30 oldAmountWasRatio = UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
31 equipName = StringManipulation.CutToLength(equip.Name, 20); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
32 unitName = StringManipulation.CutToLength(unit.Name, 20); |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 public override bool CanExecute() |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 return (unit!=null && equip!=null); |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 public override string Description |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
41 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
42 get |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
43 { |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
44 return Translation.GetTranslation("setEquipmentAmountCommandDescription", "set {0} amount for {1} to {2}", equipName, unitName, GetNewAmountString()); |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
45 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
46 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
47 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
48 /// <summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
49 /// Gets the string representation for the new amount of the equipment item to take |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
50 /// </summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 /// <returns> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 /// the string representation for the new amount of the equipment item to take |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
53 /// </returns> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
54 protected abstract string GetNewAmountString(); |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
55 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
56 public override string UndoDescription |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
57 { |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
58 get |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
59 { |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
60 string undoDescription; |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
61 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
62 if (oldAmount == 0) |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
63 { |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
64 undoDescription = Translation.GetTranslation("setEquipmentAmountCommandRemoveDescription", "remove {0} from {1}", equipName, unitName); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
65 } |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
66 else |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
67 { |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
68 undoDescription = Translation.GetTranslation("setEquipmentAmountCommandUndoDescription", "set {0} amount for {1} to {2}", equipName, unitName, GetOldAmountString()); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
69 } |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
70 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
71 return undoDescription; |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
72 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
73 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
74 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
75 /// <summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
76 /// Gets the string representation for the old amount of the equipment item to take |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
77 /// </summary> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
78 /// <returns> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
79 /// the string representation for the old amount of the equipment item to take |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 /// </returns> |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
81 protected string GetOldAmountString() |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
82 { |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
83 return oldAmountWasRatio ? GetRatioAmountString(oldAmount, UnitEquipmentRatioSelection.CalculateNumberTaken(Unit, EquipItem, oldAmount)) : GetNumberAmountString((int)oldAmount); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
84 } |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
85 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
86 protected string GetNumberAmountString(int number) |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
87 { |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
88 return Translation.GetTranslation ("equipmentAmountNumber", "{0}", number); |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
89 } |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
90 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
91 protected string GetRatioAmountString (double amount, int number) |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
92 { |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
93 string amountString; |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
94 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
95 if (amount == 100) |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
96 { |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
97 amountString = Translation.GetTranslation ("equipmentAmountAll", "all ({1})", amount, number); |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
98 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
99 else |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
100 { |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
101 amountString = Translation.GetTranslation ("equipmentAmountPercentage", "{0}% ({1})", amount, number); |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
102 } |
214
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
103 |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
104 return amountString; |
1b718b67f7f6
Re #179: Make sure that translations are used throughout UI
IBBoard <dev@ibboard.co.uk>
parents:
104
diff
changeset
|
105 } |
101
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
106 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
107 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
108 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
109 public override bool Execute() |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
110 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
111 this.Redo(); |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
112 return true; |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
113 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
114 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
115 public override void Undo () |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 if (oldAmountWasRatio) |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
118 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 unit.SetEquipmentRatio(equip, oldAmount); |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
120 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
121 else |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
122 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
123 unit.SetEquipmentAmount(equip, (int)oldAmount); |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
124 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
125 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
126 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
127 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
128 public UnitEquipmentItem EquipItem |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
129 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
130 get { return equip; } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
131 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
132 |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
133 public Unit Unit |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
134 { |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
135 get { return unit; } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
136 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
137 } |
f7b9423c2a5a
Big mess of updates, breaking our rules on "commit little and often" because the code was so ugly.
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
138 } |