private void TryAddRoom() { Room room = Corridors.Any() ? Corridors.Last().SpawnRoom(15, 15) : new Room(new Position(50, 50), 10, 10); if (!DungeonValidator.CanFeatureBeAdded(room, OccupiedPoints)) { return; } Rooms.Add(room); foreach (var p in room.GetPositions()) { OccupiedPoints.Add(p.Key, p.Value); } }
private void TryAddCorridor() { if (!Rooms.Any()) { return; } var corridor = Rooms.Last().SpawnCorridor(DMHelper.GetRandomDirection()); if (!DungeonValidator.CanFeatureBeAdded(corridor, OccupiedPoints)) { return; } Corridors.Add(corridor); foreach (var p in corridor.GetPositions()) { OccupiedPoints.Add(p.Key, p.Value); } }