IsaacRoomLayout GenerateEmptyRoomLayout()
        {
            var layout = new IsaacRoomLayout();

            layout.InitializeTiles(isaacConfig.roomWidth, isaacConfig.roomHeight, IsaacRoomTileType.Floor);
            return(layout);
        }
Beispiel #2
0
        public override IsaacRoomLayout GenerateLayout(IsaacRoom room, System.Random random, int roomWidth, int roomHeight)
        {
            var doors  = room.doorPositions;
            var layout = new IsaacRoomLayout();

            layout.InitializeTiles(roomWidth, roomHeight, IsaacRoomTileType.Empty);

            if (doors.Count > 1)
            {
                for (int i = 0; i < doors.Count; i++)
                {
                    for (int j = i + 1; j < doors.Count; j++)
                    {
                        var brushSize = random.Range(minBrushSize, maxBrushSize + 1);
                        ConnectDoors(layout, doors[i], doors[j], brushSize);
                    }
                }
            }
            else
            {
                var brushSize = random.Range(minBrushSize, maxBrushSize + 1);
                ConnectDoors(layout, doors[0], doors[0], brushSize);
            }

            return(layout);
        }