Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison api/Objects/UnitEquipmentItem.cs @ 306:886d28c1b6e5
Re #99: Define points systems
* Simplify the code and leave translations until we support them
Re #329 and re #327: Use "points" in UI
* Use new method in UnitEquipmentItem object's ToString() method
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 13 Feb 2011 16:24:12 +0000 |
parents | 92d10b06ab0f |
children |
comparison
equal
deleted
inserted
replaced
305:92d10b06ab0f | 306:886d28c1b6e5 |
---|---|
4 | 4 |
5 using System; | 5 using System; |
6 using IBBoard.CustomMath; | 6 using IBBoard.CustomMath; |
7 using IBBoard.Limits; | 7 using IBBoard.Limits; |
8 using IBBoard.WarFoundry.API.Util; | 8 using IBBoard.WarFoundry.API.Util; |
9 using IBBoard.Lang; | |
9 //using IBBoard.WarFoundry.API.Objects; | 10 //using IBBoard.WarFoundry.API.Objects; |
10 | 11 |
11 namespace IBBoard.WarFoundry.API.Objects | 12 namespace IBBoard.WarFoundry.API.Objects |
12 { | 13 { |
13 /// <summary> | 14 /// <summary> |
23 private string[] mutexGroups; | 24 private string[] mutexGroups; |
24 private UnitType unitType; | 25 private UnitType unitType; |
25 private string slotName = ""; | 26 private string slotName = ""; |
26 private ILimit minLimit; | 27 private ILimit minLimit; |
27 private ILimit maxLimit; | 28 private ILimit maxLimit; |
28 public GameSystem CurrentGameSystem | |
29 { | |
30 get { return WarFoundryCore.CurrentGameSystem; } | |
31 set { WarFoundryCore.CurrentGameSystem = value; } | |
32 } | |
33 public UnitEquipmentItem(EquipmentItem equipmentItem, UnitType equipmentFor) | 29 public UnitEquipmentItem(EquipmentItem equipmentItem, UnitType equipmentFor) |
34 : this(equipmentItem, equipmentFor, new string[0]) | 30 : this(equipmentItem, equipmentFor, new string[0]) |
35 { | 31 { |
36 //Do nothing extra | 32 //Do nothing extra |
37 } | 33 } |
66 { | 62 { |
67 base.ID = value; | 63 base.ID = value; |
68 } | 64 } |
69 } | 65 } |
70 | 66 |
71 | |
72 public string EquipmentItemID | 67 public string EquipmentItemID |
73 { | 68 { |
74 get { return item.ID; } | 69 get { return item.ID; } |
75 } | 70 } |
76 | 71 |
108 | 103 |
109 public bool RoundNumberUp | 104 public bool RoundNumberUp |
110 { | 105 { |
111 get { return roundUp; } | 106 get { return roundUp; } |
112 set { roundUp = value; } | 107 set { roundUp = value; } |
108 } | |
109 | |
110 public GameSystem GameSystem | |
111 { | |
112 get { return EquipmentItem.GameSystem; } | |
113 } | 113 } |
114 | 114 |
115 public String[] MutexGroups | 115 public String[] MutexGroups |
116 { | 116 { |
117 get { return (string[]) mutexGroups.Clone(); } | 117 get { return (string[]) mutexGroups.Clone(); } |
196 get { return item; } | 196 get { return item; } |
197 } | 197 } |
198 | 198 |
199 public override string ToString() | 199 public override string ToString() |
200 { | 200 { |
201 return CurrentGameSystem.setUnitEquipmentItemName(EquipmentItem.Name, Cost); | 201 return Translation.GetTranslation("UnitEquipmentItemName", "{0} ({1}{2} each)", Name, Cost, GameSystem.GetPointsAbbrev(Cost)); |
202 } | 202 } |
203 | 203 |
204 public bool HasAlternatives() | 204 public bool HasAlternatives() |
205 { | 205 { |
206 if (MutexGroups.Length == 0) | 206 if (MutexGroups.Length == 0) |