comparison api/Objects/UnitEquipmentItem.cs @ 94:49a83020174e

Re #116: Percentage limits on equipment items are negative * Correctly handle "equip all" for rendering of percentages
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Aug 2009 20:06:21 +0000
parents 729d9e54162c
children ced5a18d9f52
comparison
equal deleted inserted replaced
93:789dfab13449 94:49a83020174e
219 return EquipmentItem.CanBeUsedWithArmourType(otherItemType); 219 return EquipmentItem.CanBeUsedWithArmourType(otherItemType);
220 } 220 }
221 221
222 public static string FormatEquipmentAmount(UnitEquipmentItem item, double amount) 222 public static string FormatEquipmentAmount(UnitEquipmentItem item, double amount)
223 { 223 {
224 if (item.IsRatioLimit) 224 if (amount == WarFoundryCore.INFINITY)
225 {
226 return "all"; //TODO: Translate
227 }
228 else if (item.IsRatioLimit)
225 { 229 {
226 return Math.Round(amount * 100) + "%"; 230 return Math.Round(amount * 100) + "%";
227 } 231 }
228 else 232 else
229 { 233 {
230 if (amount == WarFoundryCore.INFINITY) 234 return amount.ToString();
231 {
232 return "all"; //TODO: Translate
233 }
234 else
235 {
236 return amount.ToString();
237 }
238 } 235 }
239 } 236 }
240 } 237 }
241 } 238 }