private void ParameterizeDungeon() { if (_generationParameters.RequiredOptionalEndpointNumber.HasValue) { PrepareOptionalRoutes(); } if (_generationParameters.GenerationMaxDeadEnds.HasValue) { _stepBackCounter = new StepBackCounter(_generationParameters.GenerationMaxDeadEnds.Value); } if (_generationParameters.GenerationRetryNum.HasValue) { _retryNum = _generationParameters.GenerationRetryNum.Value; } }
public PrototypeDungeonGenerator(AbstractDungeonStructure structure, int seed, GenerationParameters generationParameters = null) { _seed = seed; _random = new Random(seed); _generationParameters = generationParameters; _loadedStructure = DungeonStructureConcretizer.ConcretizeStructure(structure, _random); _loadedRooms = RoomResourceLoader.LoadRoomPrototypes(_loadedStructure); _marginHalf = structure.StructureMetaData.MarginUnit / 2f; CollectMetaData(_loadedStructure); if (_generationParameters != null) { ParameterizeDungeon(); } if (_stepBackCounter == null) { _stepBackCounter = new StepBackCounter(DefaultMaxSteps); } }