helper function for Tile.cs