diff 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
line wrap: on
line diff
--- a/api/Objects/UnitEquipmentItem.cs	Wed Jan 26 20:27:50 2011 +0000
+++ b/api/Objects/UnitEquipmentItem.cs	Sun Feb 13 16:24:12 2011 +0000
@@ -5,7 +5,8 @@
 using System;
 using IBBoard.CustomMath;
 using IBBoard.Limits;
-using IBBoard.WarFoundry.API.Util;
+using IBBoard.WarFoundry.API.Util;
+using IBBoard.Lang;
 //using IBBoard.WarFoundry.API.Objects;
 
 namespace IBBoard.WarFoundry.API.Objects
@@ -24,12 +25,7 @@
 		private UnitType unitType;
 		private string slotName = "";
 		private ILimit minLimit;
-		private ILimit maxLimit;
-        public GameSystem CurrentGameSystem
-        {
-            get { return WarFoundryCore.CurrentGameSystem; }
-            set { WarFoundryCore.CurrentGameSystem = value; }
-        }
+		private ILimit maxLimit;
 		public UnitEquipmentItem(EquipmentItem equipmentItem, UnitType equipmentFor)
 			: this(equipmentItem, equipmentFor, new string[0])
 		{
@@ -68,7 +64,6 @@
 			}
 		}
 
-
 		public string EquipmentItemID
 		{
 			get { return item.ID; }
@@ -111,6 +106,11 @@
 			get { return roundUp; }
 			set { roundUp = value; }
 		}
+		
+		public GameSystem GameSystem
+		{
+			get { return EquipmentItem.GameSystem; }
+		}
 
 		public String[] MutexGroups
 		{
@@ -198,7 +198,7 @@
 
 		public override string ToString()
 		{
-            return CurrentGameSystem.setUnitEquipmentItemName(EquipmentItem.Name, Cost);
+            return Translation.GetTranslation("UnitEquipmentItemName", "{0} ({1}{2} each)", Name, Cost, GameSystem.GetPointsAbbrev(Cost));
 		}
 
 		public bool HasAlternatives()