Example #1
0
        public void RemoveItem(string uniqueUUID, bool updateUI)
        {
            #region Linq Version
            //EventSystem.EventMessager.Instance.Raise(new Events.EventBeforeRemoveInventoryItem(item));
            //InternalItems.RemoveAll(item => item.Data.UniqueUUID == uniqueUUID);
            //EventSystem.EventMessager.Instance.Raise(new Events.EventAfterRemoveInventoryItem(item));
            #endregion Linq Version

            #region Foreach Version
            foreach (ICoreData item in InternalItems.ToArray())
            {
                if (item.BaseData.UniqueUUID == uniqueUUID)
                {
                    InternalItems.Remove(item);
                    EventSystem.EventMessenger.Instance.Raise(new Events.EventItemWasRemovedFromInventory(InventoryUUID, item, updateUI));
                }
            }
            #endregion Foreach Version
        }