From 3a687a4d58245559554dfcb17d00e71560f2696f Mon Sep 17 00:00:00 2001 From: scove Date: Tue, 21 Apr 2026 21:44:26 +0700 Subject: [PATCH] Refactor maze scripts: namespaces & cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .idea/.idea.HALLUCINATE/.idea/encodings.xml | 6 +- .idea/.idea.HALLUCINATE/.idea/workspace.xml | 56 +++-- Assets/Scripts/GameSetup/Maze/Crawler.cs | 105 +++++---- Assets/Scripts/GameSetup/Maze/Extensions.cs | 36 +-- Assets/Scripts/GameSetup/Maze/Maze.cs | 242 +++++++++++++------- Assets/Scripts/GameSetup/Maze/Prims.cs | 70 +++--- Assets/Scripts/GameSetup/Maze/Recursive.cs | 53 +++-- Assets/Scripts/GameSetup/Maze/Wilsons.cs | 178 +++++++------- 8 files changed, 460 insertions(+), 286 deletions(-) diff --git a/.idea/.idea.HALLUCINATE/.idea/encodings.xml b/.idea/.idea.HALLUCINATE/.idea/encodings.xml index df87cf95..d1daf2d1 100644 --- a/.idea/.idea.HALLUCINATE/.idea/encodings.xml +++ b/.idea/.idea.HALLUCINATE/.idea/encodings.xml @@ -1,4 +1,8 @@ - + + + + + \ No newline at end of file diff --git a/.idea/.idea.HALLUCINATE/.idea/workspace.xml b/.idea/.idea.HALLUCINATE/.idea/workspace.xml index e390bc8d..0400f241 100644 --- a/.idea/.idea.HALLUCINATE/.idea/workspace.xml +++ b/.idea/.idea.HALLUCINATE/.idea/workspace.xml @@ -4,14 +4,23 @@