/// <summary>
 /// Attempts to use an item on a tile.
 /// </summary>
 /// <param name="itemLocation">The item's location.</param>
 /// <param name="tile">The tile to use the item on.</param>
 public void UseItemOnTile(Objects.ItemLocation itemLocation, Map.Tile tile)
 {
     if (itemLocation == null || tile == null)
     {
         return;
     }
     Objects.Map.TileObject tileObj = tile.GetTopUseItem(true);
     this.UseItemOnTileObject(itemLocation, tileObj);
 }
Beispiel #2
0
        public Map.TileObject GetTopUseItem(Location worldLocation, bool useOn, Map.Tile playerTile = null)
        {
            Map.Tile pTile = playerTile;
            if (pTile == null)
            {
                pTile = this.GetPlayerTile();
            }
            if (pTile == null)
            {
                return(null);
            }

            Map.Tile tile = this.GetTile(worldLocation, pTile);
            if (tile == null)
            {
                return(null);
            }

            return(tile.GetTopUseItem(useOn));
        }