private void assignTiles(TileHead th, Tile[][] tiles) { this.rows = th.Rows; this.cols = th.Cols; for (int r = 0; r < th.Rows; ++r) { for (int c = 0; c < th.Cols; ++c) { mapTiles[r][c] = tiles[r][c]; } } for (int r = 0; r < mapTiles.Length; ++r) { for (int c = 0; c < mapTiles[0].Length; ++c) { if (mapTiles[r][c] == null) { mapTiles[r][c] = new Tile(r, c); } } } }
private TileHead readTileHead(FileStream fs) { TileHead th = new TileHead(); th.Tag = readString(fs, 4); th.Rows = readInt(fs); th.Cols = readInt(fs); return th; }