Example #1
0
        public void GenerateWorld()
        {
            m_roomManager     = new generationManager.RoomManager(m_worldGeneratorToRoomManager);
            m_masterLogicGrid = m_roomManager.GenerateRoomGrid();
            m_roomInMap       = m_roomManager.GetRoomInMap();

            m_worldGeneratorToCorridorsManager = new dataStruct.WorldGeneratorToCorridorsManager(m_masterLogicGrid, m_floor, m_tileFloor, m_wallThickness);

            m_corridorsManager = new generationManager.CorridorsManager(m_worldGeneratorToCorridorsManager);
            m_masterLogicGrid  = m_corridorsManager.GenerateCorridorsGrid();

            m_worldGeneratorToDoorManager = new dataStruct.WorldGeneratorToDoorManager(m_masterLogicGrid, m_floor, m_door, m_tileFloor, m_tiledoor, m_roomInMap);
            m_doorManager     = new generationManager.DoorManager(m_worldGeneratorToDoorManager);
            m_masterLogicGrid = m_doorManager.GenerateDoorGrid();

            m_worldGeneratorToDeadEndManager = new dataStruct.WorldGeneratorToDeadEndManager(m_masterLogicGrid, m_floor, m_door, m_corridorsManager.GetEnds());
            m_DeadEndManager  = new generationManager.DeadEndManager(m_worldGeneratorToDeadEndManager);
            m_masterLogicGrid = m_DeadEndManager.GenerateDeadEndGrid();

            m_wolrdGeneratorToWallManager = new dataStruct.WolrdGeneratorToWallManager(m_masterLogicGrid, m_wall, m_tileWall);
            m_wallManager     = new generationManager.WallManager(m_wolrdGeneratorToWallManager);
            m_masterLogicGrid = m_wallManager.GenerateWallGrid();

            m_floor.RefreshAllTiles();
            m_door.RefreshAllTiles();
            m_wall.RefreshAllTiles();

            SetPlayerSpawnPosList();

            OnWorldGenerated?.Invoke();
        }
Example #2
0
 public void GenerateWithOneRoom() // For test only
 {
     m_roomManager     = new generationManager.RoomManager(m_worldGeneratorToRoomManager);
     m_masterLogicGrid = m_roomManager.AddOneRoom();
 }