diff 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
line wrap: on
line diff
--- a/api/Objects/UnitType.cs	Fri Aug 07 19:22:08 2009 +0000
+++ b/api/Objects/UnitType.cs	Fri Aug 07 19:49:21 2009 +0000
@@ -227,14 +227,14 @@
 			return stats.GetStatValue(statName);
 		}
 		
-		public void AddEquipmentItem(UnitEquipmentItem item)
-		{
+		internal void AddEquipmentItem(UnitEquipmentItem item)
+		{
+			Console.WriteLine("Add " + item.ID + " to " + Name);
 			if (!equipment.ContainsKey(item.ID))
 			{
 				equipment.Add(item.ID, item);
 				equipmentKeyOrder.Add(item.ID);
 				AddToMutexGroup(item);
-				item.EquipmentForUnit = this;
 			}
 		}