コード例 #1
0
ファイル: EventList.cs プロジェクト: Microeinstein/EventList
        public new void RemoveAt(int index)
        {
            var e = base[index];

            base.RemoveAt(index);
            ItemRemove?.Invoke(e, index);
        }
コード例 #2
0
ファイル: ItemManager.cs プロジェクト: Ailtop/RustDocuments
    public static void RemoveItem(Item item, float fTime = 0f)
    {
        Assert.IsTrue(item.isServer, "RemoveItem: Removing a client item!");
        ItemRemove item2 = default(ItemRemove);

        item2.item = item;
        item2.time = Time.time + fTime;
        ItemRemoves.Add(item2);
    }
コード例 #3
0
        public virtual bool Remove(TItem item)
        {
            var result = _Items.Remove(item);

            if (result)
            {
                //var handlers = ItemRemove;
                //if (handlers != null)
                //    handlers(item);

                ItemRemove?.Invoke(item);
            }

            return(result);
        }
コード例 #4
0
ファイル: Inventory.cs プロジェクト: JacobLCarter/StranDEAD
    //Removes the item from the inventory list then drops the item. Turns on colliders to make it the same as it was before. Activating the object in the view
    public void RemoveItem(TheInventoryItem item)
    {
        //Debug.Log("This is the remove item");
        if (myItems.Contains(item))
        {
            myItems.Remove(item);

            item.OnDrop();

            //Debug.Log("This is the ondrop");
            Collider collider = (item as MonoBehaviour).GetComponent <Collider>();
            if (collider != null)
            {
                collider.enabled = true;
            }

            ItemRemove?.Invoke(this, new InventoryEventArgs(item));
        }
    }
コード例 #5
0
ファイル: Api.cs プロジェクト: EligiusSantori/L2Apf.NET
		public void Drop(Model.Item item, int count = 0, ItemRemove type = ItemRemove.Drop, Library.Point? point = null)
		{
			if (State == State.World)
			{
				if (item != null && item.InInventory)
				{
					if (count <= 0 || count > item.Count)
						count = item.Count;

					switch (type)
					{
						case ItemRemove.Drop:
							Library.Point _point = point.HasValue ? point.Value : World.Me.Position;
							Network.Send(new Packet.Client.RequestDropItem()
							{
								ObjectId = item.ObjectId,
								Count = count,
								Point = _point
							});
							break;
						case ItemRemove.Destroy:
							Network.Send(new Packet.Client.RequestDestroyItem()
							{
								ObjectId = item.ObjectId,
								Count = count,
							});
							break;
						case ItemRemove.Crystallize:
							Network.Send(new Packet.Client.RequestCrystallizeItem()
							{
								ObjectId = item.ObjectId,
								Count = count,
							});
							break;
					}
				}
			}
			else
				throw new Library.Exception.StateException();
		}
コード例 #6
0
ファイル: Api.cs プロジェクト: EligiusSantori/L2Apf.NET
		public void Drop(int objectId, int count = 0, ItemRemove type = ItemRemove.Drop, Library.Point? point = null)
		{
			if (State == State.World)
			{
				if (objectId != 0)
				{
					var item = World[objectId] as Model.Item;
					if (item != null)
						Drop(item, count, type, point);
				}
			}
			else
				throw new Library.Exception.StateException();
		}