comparison api/Objects/UnitType.cs @ 92:729d9e54162c

Re #111: "Replace" button doesn't always enable * Implement better fix: * Make UnitEquipmentItem ID based on unit type ID and equipment item ID * Make UnitEquipmentItem require UnitType at construction again * Remove setter from EquipmentItemForUnit * Make AddEquipmentItem method internal so that the UnitEquipmentItem and not the factory is responsible for setting up the reverse link no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Fri, 07 Aug 2009 19:49:21 +0000
parents 46ad6f478203
children 789dfab13449
comparison
equal deleted inserted replaced
91:571d8ddc7d9a 92:729d9e54162c
225 public string GetStatValue(string statName) 225 public string GetStatValue(string statName)
226 { 226 {
227 return stats.GetStatValue(statName); 227 return stats.GetStatValue(statName);
228 } 228 }
229 229
230 public void AddEquipmentItem(UnitEquipmentItem item) 230 internal void AddEquipmentItem(UnitEquipmentItem item)
231 { 231 {
232 Console.WriteLine("Add " + item.ID + " to " + Name);
232 if (!equipment.ContainsKey(item.ID)) 233 if (!equipment.ContainsKey(item.ID))
233 { 234 {
234 equipment.Add(item.ID, item); 235 equipment.Add(item.ID, item);
235 equipmentKeyOrder.Add(item.ID); 236 equipmentKeyOrder.Add(item.ID);
236 AddToMutexGroup(item); 237 AddToMutexGroup(item);
237 item.EquipmentForUnit = this;
238 } 238 }
239 } 239 }
240 240
241 private void AddToMutexGroup(UnitEquipmentItem item) 241 private void AddToMutexGroup(UnitEquipmentItem item)
242 { 242 {