public void createMap(csMapbuilder builder, int w, int h) { //while (true) { if (builder.Build_OneStartRoom()) { //break; } //} this.mapData.map = new List <AbstractEntity> [w, h]; for (int y = 0; y < this.mapData.getHeight(); y++) { for (int x = 0; x < this.mapData.getWidth(); x++) { this.mapData.map[x, y] = new List <AbstractEntity>(); if (builder.map[x, y] == 1) { this.entityFactory.CreateWallMapSquare(x, y, RLColor.Cyan); } else if (builder.map[x, y] == 2) { this.entityFactory.CreateDoorMapSquare(x, y, RLColor.Yellow); } else { this.entityFactory.CreateFloorMapSquare(x, y); } } } }
public DungeonMap( ) { //map = RogueSharp.Map.Create( mapCreationStrategy ); features = new Dictionary <Point, TileFeature>(); actors = new Dictionary <Actor, Point>(); csMapbuilder b = new csMapbuilder(GameConstants.MapWidth, GameConstants.MapHeight); b.Build_OneStartRoom(); Rooms = b.GetRooms(); map = new Map(GameConstants.MapWidth, GameConstants.MapHeight); CopyMap(b); AddPlayer(); }
void buildDefaultMap() { csMapbuilder b = new csMapbuilder(mapRect.Width, mapRect.Height); b.Build_OneStartRoom(); for (int x = 0; x < mapRect.Width; x++) { for (int y = 0; y < mapRect.Height; y++) { TileType type = ( TileType )b.GetCell(x, y); SetTile(new Point(x, y), type); } } rooms = b.GetRooms(); }
public void CreateMap(csMapbuilder builder, int w, int h) { //csMapbuilder builder = null; //while (true) { //builder = new csMapbuilder(w, h); if (builder.Build_OneStartRoom()) { //break; } //} this.mapData.map = new List <AbstractEntity> [w, h]; for (int y = 0; y < this.mapData.getHeight(); y++) { for (int x = 0; x < this.mapData.getWidth(); x++) { this.mapData.map[x, y] = new List <AbstractEntity>(); if (builder.map[x, y] == 1) { this.entityFactory.CreateWallMapSquare(x, y, RLColor.Green); } else if (builder.map[x, y] == 2) { this.entityFactory.CreateDoorMapSquare(x, y, RLColor.Brown); } else { this.entityFactory.CreateFloorMapSquare(x, y); } } } Point p = this.GetRandomSq(); this.entityFactory.CreateSelfDestructConsole(p.X, p.Y); }