Refactor maze scripts: namespaces & cleanup
Move Maze-related scripts into the Hallucinate.GameSetup.Maze namespace and perform a broad refactor and cleanup. Make MapLocation a readonly struct, add Corridor/Wall/Path constants, and convert Maze into a clearer base class with serialized fields (width, depth, scale, mapParentObject), proper initialization, virtual Generate, and safer DrawMap behavior. Update neighbor-count helpers, tighten method visibility, and improve algorithm implementations (Crawler, Prims, Recursive, Wilsons) to use the new constants and more robust logic (including logging and loop guards). Add a Fisher–Yates Shuffle extension with a static RNG under Hallucinate.GameSetup.Maze.Extensions. Also update IDE metadata (.idea encodings.xml and workspace.xml) to record file encodings and some project settings.
This commit is contained in:
6
.idea/.idea.HALLUCINATE/.idea/encodings.xml
generated
6
.idea/.idea.HALLUCINATE/.idea/encodings.xml
generated
@@ -1,4 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise">
|
||||
<file url="file://$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Crawler.cs" charset="ISO-8859-1" />
|
||||
<file url="file://$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Extensions.cs" charset="ISO-8859-1" />
|
||||
<file url="file://$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Wilsons.cs" charset="ISO-8859-1" />
|
||||
</component>
|
||||
</project>
|
||||
56
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
56
.idea/.idea.HALLUCINATE/.idea/workspace.xml
generated
@@ -4,14 +4,23 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="" />
|
||||
<list default="true" id="f9183c68-daf0-43b8-be4c-fad79983f91b" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/encodings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.HALLUCINATE/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Crawler.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Crawler.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Extensions.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Extensions.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Maze.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Maze.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Prims.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Prims.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Recursive.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Recursive.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Wilsons.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GameSetup/Maze/Wilsons.cs" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="EmbeddingIndexingInfo">
|
||||
<option name="cachedIndexableFilesCount" value="10" />
|
||||
<option name="cachedIndexableFilesCount" value="34" />
|
||||
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
@@ -26,6 +35,7 @@
|
||||
<commands />
|
||||
<urls />
|
||||
</component>
|
||||
<component name="MetaFilesCheckinStateConfiguration" checkMetaFiles="true" />
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 4
|
||||
}</component>
|
||||
@@ -34,27 +44,27 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.MCP Project settings loaded": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"junie.onboarding.icon.badge.shown": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"to.speed.mode.migration.done": "true",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.MCP Project settings loaded": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"junie.onboarding.icon.badge.shown": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"to.speed.mode.migration.done": "true",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
|
||||
<configuration name="Standalone Player" type="RunUnityExe" factoryName="Unity Executable">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/../BAI MUTIPLAY\HALLUCINATE.exe" />
|
||||
@@ -127,12 +137,14 @@
|
||||
<workItem from="1775313757656" duration="8722000" />
|
||||
<workItem from="1776130728673" duration="7161000" />
|
||||
<workItem from="1776255558934" duration="1896000" />
|
||||
<workItem from="1776780627914" duration="1908000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityCheckinConfiguration" checkUnsavedScenes="true" />
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="true" />
|
||||
<component name="UnityProjectDiscoverer">
|
||||
<option name="hasUnityReference" value="true" />
|
||||
|
||||
Reference in New Issue
Block a user