Пример #1
0
        void RemoveAllTrackedItems()
        {
            for (int i = trackedItems.Count - 1; i >= 0; i--)
            {
                EquipmentTrackedItem trackedItem = trackedItems[i];

                trackedItems.RemoveAt(i);

                if (ItemRemoved != null)
                {
                    ItemRemoved(trackedItem);
                }

                trackedItem.Dispose();
            }
        }
Пример #2
0
        void RemoveItem(WorldObject obj)
        {
            for (int i = trackedItems.Count - 1; i >= 0; i--)
            {
                if (trackedItems[i].Id == obj.Id)
                {
                    EquipmentTrackedItem trackedItem = trackedItems[i];

                    trackedItems.RemoveAt(i);

                    if (ItemRemoved != null)
                    {
                        ItemRemoved(trackedItem);
                    }

                    trackedItem.Dispose();
                }
            }
        }
Пример #3
0
        /// <summary>
        /// This will process an item for addition to our trackedItems list.
        /// It will not allow an item to be added twice.
        /// </summary>
        /// <param name="obj"></param>
        void AddItem(WorldObject obj)
        {
            foreach (EquipmentTrackedItem item in trackedItems)
            {
                if (item.Id == obj.Id)
                {
                    return;
                }
            }

            EquipmentTrackedItem trackedItem = new EquipmentTrackedItem(obj.Id);

            trackedItems.Add(trackedItem);

            if (ItemAdded != null)
            {
                ItemAdded(trackedItem);
            }
        }
Пример #4
0
		/// <summary>
		/// This will process an item for addition to our trackedItems list.
		/// It will not allow an item to be added twice.
		/// </summary>
		/// <param name="obj"></param>
		void AddItem(WorldObject obj)
		{
			foreach (EquipmentTrackedItem item in trackedItems)
			{
				if (item.Id == obj.Id)
					return;
			}

			EquipmentTrackedItem trackedItem = new EquipmentTrackedItem(obj.Id);

			trackedItems.Add(trackedItem);

			if (ItemAdded != null)
				ItemAdded(trackedItem);
		}