public ITile GenerateNewTile(int x, int y, TileType type) { if (tileArray[x, y] != null) //If theres a tile, activate it's changed event. { tileArray[x, y].RaiseChangedEvent(type); } switch (type) { case TileType.Space: Tiles.Floor.Space space = new Tiles.Floor.Space(x, y, this); return(space); case TileType.Floor: Tiles.Floor.Floor floor = new Tiles.Floor.Floor(x, y, this); return(floor); case TileType.Wall: Tiles.Wall.Wall wall = new Tiles.Wall.Wall(x, y, this); return(wall); default: return(null); } }
private void ParseNameArray() { tileArray = new Tile[mapWidth, mapHeight]; for (int z = 0; z < mapHeight; z++) { for (int x = 0; x < mapWidth; x++) { switch (nameArray[x, z]) { case "wall": case "Wall": tileArray[x, z] = new Tiles.Wall.Wall(x, z, this); break; case "floor": case "Floor": tileArray[x, z] = new Tiles.Floor.Floor(x, z, this); break; case "space": case "Space": tileArray[x, z] = new Tiles.Floor.Space(x, z, this); break; default: break; } } } }
private void NewMap() { LogManager.Log("***** Cannot find map. Generating blank map. *****", LogLevel.Warning); mapWidth = 50; mapHeight = 50; tileArray = new Tile[mapWidth, mapHeight]; for (int x = 0; x < mapWidth; x++) { for (int y = 0; y < mapHeight; y++) { tileArray[x, y] = new Tiles.Floor.Floor(x, y, this); } } }
private void NewMap() { LogManager.Log("***** Cannot find map. Generating blank map. *****", LogLevel.Warning); mapWidth = 50; mapHeight = 50; tileArray = new Tile[mapWidth, mapHeight]; for (int x = 0; x < mapWidth; x++) { for (int y = 0; y < mapHeight; y++) { tileArray[x,y] = new Tiles.Floor.Floor(x, y, this); } } }
public ITile GenerateNewTile(int x, int y, TileType type) { if (tileArray[x, y] != null) //If theres a tile, activate it's changed event. tileArray[x, y].RaiseChangedEvent(type); switch (type) { case TileType.Space: Tiles.Floor.Space space = new Tiles.Floor.Space(x, y, this); return space; case TileType.Floor: Tiles.Floor.Floor floor = new Tiles.Floor.Floor(x, y, this); return floor; case TileType.Wall: Tiles.Wall.Wall wall = new Tiles.Wall.Wall(x, y, this); return wall; default: return null; } }