public static IsaacRoomTile GetTileAt(int x, int z, IsaacRoomLayout layout) { if (x < 0 || x >= layout.Tiles.GetLength(0) || z < 0 || z >= layout.Tiles.GetLength(1)) { var invalidTile = new IsaacRoomTile(); invalidTile.tileType = IsaacRoomTileType.Empty; return(invalidTile); } return(layout.Tiles[x, z]); }
public void InitializeTiles(int width, int height, IsaacRoomTileType tileType) { Tiles = new IsaacRoomTile[width, height]; for (int x = 0; x < width; x++) { for (int z = 0; z < height; z++) { var tile = new IsaacRoomTile(); tile.tileType = tileType; Tiles[x, z] = tile; } } }