public MyInventorySynchronizer(MyInventory inventory, MyMustBeInventorySynchronizedDelegate mustBeInventorySynchronizedDelegate) 
        {
            m_inventoryItemsHelper = new List<MyInventoryItem>();
            m_inventoryItemsToAdd = new List<MyInventoryItem>();
            m_inventoryItemsAmountChanges = new List<MyInventoryItemAmountDefinition>();
            m_mustBeInventorySynchronizedDelegate = mustBeInventorySynchronizedDelegate;
            m_inventory = inventory;

            //MyMinerGame.OnGameUpdate += MyMinerGame_OnGameUpdate;
        }
Example #2
0
        public MyInventorySynchronizer(MyInventory inventory, MyMustBeInventorySynchronizedDelegate mustBeInventorySynchronizedDelegate)
        {
            m_inventoryItemsHelper                = new List <MyInventoryItem>();
            m_inventoryItemsToAdd                 = new List <MyInventoryItem>();
            m_inventoryItemsAmountChanges         = new List <MyInventoryItemAmountDefinition>();
            m_mustBeInventorySynchronizedDelegate = mustBeInventorySynchronizedDelegate;
            m_inventory = inventory;

            //MyMinerGame.OnGameUpdate += MyMinerGame_OnGameUpdate;
        }
        public void Close() 
        {
            foreach (var item in m_inventoryItemsToAdd) 
            {
                MyInventory.CloseInventoryItem(item);
            }
            m_inventoryItemsToAdd.Clear();
            m_inventoryItemsToAdd = null;

            m_inventoryItemsAmountChanges.Clear();
            m_inventoryItemsAmountChanges = null;

            m_inventoryItemsHelper.Clear();
            m_inventoryItemsHelper = null;

            m_mustBeInventorySynchronizedDelegate = null;

            m_inventory = null;

            //MyMinerGame.OnGameUpdate -= MyMinerGame_OnGameUpdate;
        }
Example #4
0
        public void Close()
        {
            foreach (var item in m_inventoryItemsToAdd)
            {
                MyInventory.CloseInventoryItem(item);
            }
            m_inventoryItemsToAdd.Clear();
            m_inventoryItemsToAdd = null;

            m_inventoryItemsAmountChanges.Clear();
            m_inventoryItemsAmountChanges = null;

            m_inventoryItemsHelper.Clear();
            m_inventoryItemsHelper = null;

            m_mustBeInventorySynchronizedDelegate = null;

            m_inventory = null;

            //MyMinerGame.OnGameUpdate -= MyMinerGame_OnGameUpdate;
        }