コード例 #1
0
        public override void Update(GameTime gameTime, SignsOfLife.Maps.Map map)
        {
            if (base.IsOnGround())
            {
                var item = TrySelectFallenItem();

                if (item != null)
                {
                    //base.GetContainerUI().AddItemAutoStackRandom(InventoryItemHandler.CopyInventoryItem(item));
                    //item.RemoveSelf();
                    item._map.RemoveItemFromWorld(item);
                    //base.GetContainerUI().AddItemAutoStack(item);
                }
            }

            base.Update(gameTime, map);
        }
コード例 #2
0
 private void SelectAndDropTile(SignsOfLife.Maps.Map map, ITile t1)
 {
     if (t1 != null)
     {
         int dropid = t1.TileData.DropId;
         if (dropid > 0)
         {
             if (t1.TileData.CanPickUp)
             {
             }
             InventoryItem item = new BlockItem(t1.TileData);//InventoryItemHandler.GetNewItemByItemTypeID(dropid);
             item.Pos = new Vector2(this.X, this.Y);
             //map.AddDynamicEntity(item);
             map.AddItemFromServer(item);
             //map.AddNewItem(this.X, this.Y, item);
         }
     }
 }