public static int GetTotalItemsStack(SlotGroup slotGroup) { var map = slotGroup.parent.Map; Dictionary <SlotGroup, int> dk = null; if (!heldItems.ContainsKey(map)) { dk = new Dictionary <SlotGroup, int>(); heldItems[map] = dk; } else { dk = heldItems[map]; } if (!dk.ContainsKey(slotGroup)) { int totalStack = slotGroup.TotalHeldItemsStack(); dk[slotGroup] = totalStack; return(totalStack); } else { return(dk[slotGroup]); } }
public static void UpdateSlotGroup(Map map, SlotGroup slotGroup) { Dictionary <SlotGroup, int> dk = null; if (!heldItems.ContainsKey(map)) { dk = new Dictionary <SlotGroup, int>(); heldItems[map] = dk; } else { dk = heldItems[map]; } dk[slotGroup] = slotGroup.TotalHeldItemsStack(); }