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 @@
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -26,6 +35,7 @@
+
{
"associatedIndex": 4
}
@@ -34,27 +44,27 @@
- {
+ "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"
}
-}]]>
+}
@@ -127,12 +137,14 @@
+
+
diff --git a/Assets/Scripts/GameSetup/Maze/Crawler.cs b/Assets/Scripts/GameSetup/Maze/Crawler.cs
index bb1044e4..62641f8d 100644
--- a/Assets/Scripts/GameSetup/Maze/Crawler.cs
+++ b/Assets/Scripts/GameSetup/Maze/Crawler.cs
@@ -1,51 +1,70 @@
-using System.Collections;
-using System.Collections.Generic;
using UnityEngine;
-public class Crawler : Maze
+namespace Hallucinate.GameSetup.Maze
{
-
- public override void Generate()
+ ///
+ /// A maze generation algorithm that "crawls" through the grid in a semi-random walk.
+ /// It creates long, winding corridors by moving vertically or horizontally.
+ ///
+ public class Crawler : Maze
{
- //for (int i = 0; i < 2; i++)
- // CrawlV();
-
- //for(int i = 0; i < 3; i++)
- // CrawlH();
- }
-
- void CrawlV()
- {
- bool done = false;
- int x = Random.Range(1,width-1);
- int z = 1;
-
- while (!done)
+ ///
+ /// Orchestrates the crawling generation.
+ /// (Currently empty as per original procedural logic).
+ ///
+ public override void Generate()
{
- map[x, z] = 0;
- if (Random.Range(0, 100) < 50)
- x += Random.Range(-1, 2);
- else
- z += Random.Range(0, 2);
- done |= (x < 1 || x >= width-1 || z < 1 || z >= depth-1);
+ // Implementation can be expanded as needed.
+ }
+
+ ///
+ /// Performs a vertical crawl starting from a random X position at the bottom.
+ ///
+ protected void CrawlV()
+ {
+ bool done = false;
+ int x = Random.Range(1, width - 1);
+ int z = 1;
+
+ while (!done)
+ {
+ map[x, z] = Corridor;
+ if (Random.Range(0, 100) < 50)
+ {
+ x += Random.Range(-1, 2);
+ }
+ else
+ {
+ z += Random.Range(0, 2);
+ }
+
+ done |= (x < 1 || x >= width - 1 || z < 1 || z >= depth - 1);
+ }
+ }
+
+ ///
+ /// Performs a horizontal crawl starting from a random Z position at the left.
+ ///
+ protected void CrawlH()
+ {
+ bool done = false;
+ int x = 1;
+ int z = Random.Range(1, depth - 1);
+
+ while (!done)
+ {
+ map[x, z] = Corridor;
+ if (Random.Range(0, 100) < 50)
+ {
+ x += Random.Range(0, 2);
+ }
+ else
+ {
+ z += Random.Range(-1, 2);
+ }
+
+ done |= (x < 1 || x >= width - 1 || z < 1 || z >= depth - 1);
+ }
}
}
-
- void CrawlH()
- {
- bool done = false;
- int x = 1;
- int z = Random.Range(1,depth-1);
-
- while (!done)
- {
- map[x, z] = 0;
- if (Random.Range(0, 100) < 50)
- x += Random.Range(0, 2);
- else
- z += Random.Range(-1, 2);
- done |= (x < 1 || x >= width-1 || z < 1 || z >= depth-1);
- }
- }
-
}
diff --git a/Assets/Scripts/GameSetup/Maze/Extensions.cs b/Assets/Scripts/GameSetup/Maze/Extensions.cs
index f27ee83e..bdb306b1 100644
--- a/Assets/Scripts/GameSetup/Maze/Extensions.cs
+++ b/Assets/Scripts/GameSetup/Maze/Extensions.cs
@@ -1,21 +1,31 @@
-using System.Collections;
using System.Collections.Generic;
-using UnityEngine;
-public static class Extensions
+namespace Hallucinate.GameSetup.Maze.Extensions
{
- private static System.Random rng = new System.Random();
- public static void Shuffle(this IList list)
+ ///
+ /// Provides utility extension methods for maze generation algorithms.
+ ///
+ public static class Extensions
{
- int n = list.Count;
- while (n > 1)
+ private static System.Random _rng = new System.Random();
+
+ ///
+ /// Shuffles the elements of an using the Fisher-Yates algorithm.
+ /// This is used to randomize directions for maze generation.
+ ///
+ /// The type of elements in the list.
+ /// The list to shuffle.
+ public static void Shuffle(this IList list)
{
- n--;
- int k = rng.Next(n + 1);
- T value = list[k];
- list[k] = list[n];
- list[n] = value;
+ int n = list.Count;
+ while (n > 1)
+ {
+ n--;
+ int k = _rng.Next(n + 1);
+ T value = list[k];
+ list[k] = list[n];
+ list[n] = value;
+ }
}
}
-
}
diff --git a/Assets/Scripts/GameSetup/Maze/Maze.cs b/Assets/Scripts/GameSetup/Maze/Maze.cs
index 4a969eb2..f2f5f8ad 100644
--- a/Assets/Scripts/GameSetup/Maze/Maze.cs
+++ b/Assets/Scripts/GameSetup/Maze/Maze.cs
@@ -1,100 +1,178 @@
- using System.Collections;
using System.Collections.Generic;
using UnityEngine;
-public class MapLocation
+namespace Hallucinate.GameSetup.Maze
{
- public int x;
- public int z;
-
- public MapLocation(int _x, int _z)
+ ///
+ /// Represents a 2D coordinate on the maze grid.
+ /// Used as a lightweight value type to avoid GC allocations.
+ ///
+ public readonly struct MapLocation
{
- x = _x;
- z = _z;
- }
-}
+ public readonly int x;
+ public readonly int z;
-public class Maze : MonoBehaviour
-{
- public List directions = new List() {
- new MapLocation(1,0),
- new MapLocation(0,1),
- new MapLocation(-1,0),
- new MapLocation(0,-1) };
- public int width = 30; //x length
- public int depth = 30; //z length
- public byte[,] map;
- public int scale = 6;
- public Transform _mapParentObjet;
-
- // Start is called before the first frame update
- void Start()
- {
- InitialiseMap();
- Generate();
- DrawMap();
+ public MapLocation(int _x, int _z)
+ {
+ x = _x;
+ z = _z;
+ }
}
- void InitialiseMap()
+ ///
+ /// The base class for maze generation.
+ /// Handles map initialization, basic neighbor counting logic, and debug rendering.
+ ///
+ public class Maze : MonoBehaviour
{
- map = new byte[width,depth];
- for (int z = 0; z < depth; z++)
- for (int x = 0; x < width; x++)
+ #region Constants
+ public const byte Corridor = 0;
+ public const byte Wall = 1;
+ public const byte Path = 2;
+ #endregion
+
+ #region Fields
+ [Header("Maze Settings")]
+ [SerializeField] protected int width = 30; // x length
+ [SerializeField] protected int depth = 30; // z length
+ [SerializeField] protected int scale = 6;
+
+ [Header("Hierarchy Settings")]
+ [UnityEngine.Serialization.FormerlySerializedAs("_mapParentObjet")]
+ [SerializeField] protected Transform mapParentObject;
+
+ ///
+ /// List of cardinal directions used for neighbor checking and navigation.
+ ///
+ protected List directions = new List()
+ {
+ new MapLocation(1, 0),
+ new MapLocation(0, 1),
+ new MapLocation(-1, 0),
+ new MapLocation(0, -1)
+ };
+
+ ///
+ /// 2D array representing the maze grid.
+ /// 0 = Corridor, 1 = Wall, 2 = Special Path.
+ ///
+ public byte[,] map;
+ #endregion
+
+ protected virtual void Start()
+ {
+ InitialiseMap();
+ Generate();
+ DrawMap();
+ }
+
+ ///
+ /// Initializes the map array and fills it with walls.
+ ///
+ protected void InitialiseMap()
+ {
+ map = new byte[width, depth];
+ for (int z = 0; z < depth; z++)
{
- map[x, z] = 1; //1 = wall 0 = corridor
- }
- }
-
- public virtual void Generate()
- {
- for (int z = 0; z < depth; z++)
- for (int x = 0; x < width; x++)
- {
- if(Random.Range(0,100) < 50)
- map[x, z] = 0; //1 = wall 0 = corridor
- }
- }
-
- void DrawMap()
- {
- for (int z = 0; z < depth; z++)
- for (int x = 0; x < width; x++)
- {
- if (map[x, z] == 1)
+ for (int x = 0; x < width; x++)
{
- Vector3 pos = new Vector3(x * scale, 0, z * scale);
- GameObject wall = GameObject.CreatePrimitive(PrimitiveType.Cube);
- wall.transform.localScale = new Vector3(scale, scale, scale);
- wall.transform.position = pos;
- wall.transform.SetParent(_mapParentObjet.transform);
+ map[x, z] = Wall;
}
}
- }
+ }
- public int CountSquareNeighbours(int x, int z)
- {
- int count = 0;
- if (x <= 0 || x >= width - 1 || z <= 0 || z >= depth - 1) return 5;
- if (map[x - 1, z] == 0) count++;
- if (map[x + 1, z] == 0) count++;
- if (map[x, z + 1] == 0) count++;
- if (map[x, z - 1] == 0) count++;
- return count;
- }
+ ///
+ /// Virtual method to be overridden by specific maze generation algorithms.
+ /// Default implementation creates a random noise-based map.
+ ///
+ public virtual void Generate()
+ {
+ for (int z = 0; z < depth; z++)
+ {
+ for (int x = 0; x < width; x++)
+ {
+ if (Random.Range(0, 100) < 50)
+ {
+ map[x, z] = Corridor;
+ }
+ }
+ }
+ }
- public int CountDiagonalNeighbours(int x, int z)
- {
- int count = 0;
- if (x <= 0 || x >= width - 1 || z <= 0 || z >= depth - 1) return 5;
- if (map[x - 1, z - 1] == 0) count++;
- if (map[x + 1, z + 1] == 0) count++;
- if (map[x - 1, z + 1] == 0) count++;
- if (map[x + 1, z - 1] == 0) count++;
- return count;
- }
+ ///
+ /// Renders the maze in the scene using Unity primitives.
+ ///
+ protected void DrawMap()
+ {
+ for (int z = 0; z < depth; z++)
+ {
+ for (int x = 0; x < width; x++)
+ {
+ if (map[x, z] == Wall)
+ {
+ Vector3 pos = new Vector3(x * scale, 0, z * scale);
+ GameObject wall = GameObject.CreatePrimitive(PrimitiveType.Cube);
+ wall.transform.localScale = new Vector3(scale, scale, scale);
+ wall.transform.position = pos;
+
+ if (mapParentObject != null)
+ {
+ wall.transform.SetParent(mapParentObject);
+ }
+ }
+ }
+ }
+ }
- public int CountAllNeighbours(int x, int z)
- {
- return CountSquareNeighbours(x,z) + CountDiagonalNeighbours(x,z);
+ #region Helpers
+ ///
+ /// Counts the number of horizontal and vertical neighbors that are corridors.
+ ///
+ /// X coordinate.
+ /// Z coordinate.
+ /// The count of square neighbors.
+ public int CountSquareNeighbours(int x, int z)
+ {
+ int count = 0;
+ if (x <= 0 || x >= width - 1 || z <= 0 || z >= depth - 1) return 5;
+
+ if (map[x - 1, z] == Corridor) count++;
+ if (map[x + 1, z] == Corridor) count++;
+ if (map[x, z + 1] == Corridor) count++;
+ if (map[x, z - 1] == Corridor) count++;
+
+ return count;
+ }
+
+ ///
+ /// Counts the number of diagonal neighbors that are corridors.
+ ///
+ /// X coordinate.
+ /// Z coordinate.
+ /// The count of diagonal neighbors.
+ public int CountDiagonalNeighbours(int x, int z)
+ {
+ int count = 0;
+ if (x <= 0 || x >= width - 1 || z <= 0 || z >= depth - 1) return 5;
+
+ if (map[x - 1, z - 1] == Corridor) count++;
+ if (map[x + 1, z + 1] == Corridor) count++;
+ if (map[x - 1, z + 1] == Corridor) count++;
+ if (map[x + 1, z - 1] == Corridor) count++;
+
+ return count;
+ }
+
+ ///
+ /// Counts all neighbors (square + diagonal) that are corridors.
+ ///
+ /// X coordinate.
+ /// Z coordinate.
+ /// Total neighbor count.
+ public int CountAllNeighbours(int x, int z)
+ {
+ return CountSquareNeighbours(x, z) + CountDiagonalNeighbours(x, z);
+ }
+ #endregion
}
}
diff --git a/Assets/Scripts/GameSetup/Maze/Prims.cs b/Assets/Scripts/GameSetup/Maze/Prims.cs
index d5c5ccb5..40d7fe29 100644
--- a/Assets/Scripts/GameSetup/Maze/Prims.cs
+++ b/Assets/Scripts/GameSetup/Maze/Prims.cs
@@ -1,39 +1,51 @@
-using System.Collections;
using System.Collections.Generic;
using UnityEngine;
-public class Prims : Maze
+namespace Hallucinate.GameSetup.Maze
{
- public override void Generate()
+ ///
+ /// Implements a simplified version of Prim's algorithm for maze generation.
+ /// It picks walls at random and converts them into corridors if they only have one corridor neighbor.
+ ///
+ public class Prims : Maze
{
- int x = 2;
- int z = 2;
-
- map[x, z] = 0;
-
- List walls = new List();
- walls.Add(new MapLocation(x + 1, z));
- walls.Add(new MapLocation(x - 1, z));
- walls.Add(new MapLocation(x, z + 1));
- walls.Add(new MapLocation(x, z - 1));
-
- int countloops = 0;
- while (walls.Count > 0 && countloops < 5000)
+ ///
+ /// Generates the maze using Prim's algorithm logic.
+ ///
+ public override void Generate()
{
- int rwall = Random.Range(0, walls.Count);
- x = walls[rwall].x;
- z = walls[rwall].z;
- walls.RemoveAt(rwall);
- if (CountSquareNeighbours(x, z) == 1)
- {
- map[x, z] = 0;
- walls.Add(new MapLocation(x + 1, z));
- walls.Add(new MapLocation(x - 1, z));
- walls.Add(new MapLocation(x, z + 1));
- walls.Add(new MapLocation(x, z - 1));
- }
+ int x = 2;
+ int z = 2;
- countloops++;
+ map[x, z] = Corridor;
+
+ List walls = new List
+ {
+ new MapLocation(x + 1, z),
+ new MapLocation(x - 1, z),
+ new MapLocation(x, z + 1),
+ new MapLocation(x, z - 1)
+ };
+
+ int countloops = 0;
+ while (walls.Count > 0 && countloops < 5000)
+ {
+ int rwall = Random.Range(0, walls.Count);
+ x = walls[rwall].x;
+ z = walls[rwall].z;
+ walls.RemoveAt(rwall);
+
+ if (CountSquareNeighbours(x, z) == 1)
+ {
+ map[x, z] = Corridor;
+ walls.Add(new MapLocation(x + 1, z));
+ walls.Add(new MapLocation(x - 1, z));
+ walls.Add(new MapLocation(x, z + 1));
+ walls.Add(new MapLocation(x, z - 1));
+ }
+
+ countloops++;
+ }
}
}
}
diff --git a/Assets/Scripts/GameSetup/Maze/Recursive.cs b/Assets/Scripts/GameSetup/Maze/Recursive.cs
index acf03545..7c9d0084 100644
--- a/Assets/Scripts/GameSetup/Maze/Recursive.cs
+++ b/Assets/Scripts/GameSetup/Maze/Recursive.cs
@@ -1,25 +1,40 @@
-using System.Collections;
-using System.Collections.Generic;
+using Hallucinate.GameSetup.Maze.Extensions;
using UnityEngine;
-public class Recursive : Maze
+namespace Hallucinate.GameSetup.Maze
{
- public override void Generate()
+ ///
+ /// A recursive backtracker algorithm for maze generation.
+ /// It explores the grid randomly and backtracks when it reaches a dead end.
+ ///
+ public class Recursive : Maze
{
- Generate(5, 5);
+ ///
+ /// Entry point for the recursive generation.
+ /// Starts from a fixed position (5, 5).
+ ///
+ public override void Generate()
+ {
+ Generate(5, 5);
+ }
+
+ ///
+ /// Internal recursive method that carves corridors by exploring neighbors in a random order.
+ ///
+ /// The current X coordinate.
+ /// The current Z coordinate.
+ protected void Generate(int x, int z)
+ {
+ if (CountSquareNeighbours(x, z) >= 2) return;
+
+ map[x, z] = Corridor;
+
+ directions.Shuffle();
+
+ Generate(x + directions[0].x, z + directions[0].z);
+ Generate(x + directions[1].x, z + directions[1].z);
+ Generate(x + directions[2].x, z + directions[2].z);
+ Generate(x + directions[3].x, z + directions[3].z);
+ }
}
-
- void Generate(int x, int z)
- {
- if (CountSquareNeighbours(x, z) >= 2) return;
- map[x, z] = 0;
-
- directions.Shuffle();
-
- Generate(x + directions[0].x, z + directions[0].z);
- Generate(x + directions[1].x, z + directions[1].z);
- Generate(x + directions[2].x, z + directions[2].z);
- Generate(x + directions[3].x, z + directions[3].z);
- }
-
}
diff --git a/Assets/Scripts/GameSetup/Maze/Wilsons.cs b/Assets/Scripts/GameSetup/Maze/Wilsons.cs
index 1eb37220..b7f2ae8f 100644
--- a/Assets/Scripts/GameSetup/Maze/Wilsons.cs
+++ b/Assets/Scripts/GameSetup/Maze/Wilsons.cs
@@ -1,108 +1,132 @@
-using System.Collections;
using System.Collections.Generic;
using UnityEngine;
-public class Wilsons : Maze
+namespace Hallucinate.GameSetup.Maze
{
-
- List notUsed = new List();
-
- public override void Generate()
+ ///
+ /// Implements Wilson's algorithm for generating a Uniform Spanning Tree of the grid.
+ /// It uses loop-erased random walks to connect unvisited cells to the existing maze.
+ ///
+ public class Wilsons : Maze
{
- //create a starting cell
- int x = Random.Range(2, width - 1);
- int z = Random.Range(2, depth - 1);
- map[x, z] = 2;
+ private List _notUsed = new List();
- while(GetAvailableCells() > 1)
- RandomWalk();
- }
-
- int CountSquareMazeNeighbours(int x, int z)
- {
- int count = 0;
- for (int d = 0; d < directions.Count; d++)
+ ///
+ /// Generates the maze using Wilson's algorithm logic.
+ ///
+ public override void Generate()
{
- int nx = x + directions[d].x;
- int nz = z + directions[d].z;
- if (map[nx, nz] == 2)
+ // Create a starting cell
+ int x = Random.Range(2, width - 1);
+ int z = Random.Range(2, depth - 1);
+ map[x, z] = Path;
+
+ while (GetAvailableCells() > 1)
{
- count++;
+ RandomWalk();
}
}
- return count;
- }
-
- int GetAvailableCells()
- {
- notUsed.Clear();
- for (int z = 1; z < depth - 1; z++)
- for (int x = 1; x < width - 1; x++)
+ ///
+ /// Counts how many neighbors are already part of the finalized "Path".
+ ///
+ private int CountSquareMazeNeighbours(int x, int z)
+ {
+ int count = 0;
+ for (int d = 0; d < directions.Count; d++)
{
- if (CountSquareMazeNeighbours(x, z) == 0)
+ int nx = x + directions[d].x;
+ int nz = z + directions[d].z;
+
+ if (map[nx, nz] == Path)
{
- notUsed.Add(new MapLocation(x, z));
+ count++;
}
}
- return notUsed.Count;
- }
+ return count;
+ }
- void RandomWalk()
- {
- List inWalk = new List();
- int cx;
- int cz;
- int rstartIndex = Random.Range(0, notUsed.Count);
-
- cx = notUsed[rstartIndex].x;
- cz = notUsed[rstartIndex].z;
-
- inWalk.Add(new MapLocation(cx, cz));
-
- int loop = 0;
- bool validPath = false;
- while (cx > 0 && cx < width - 1 && cz > 0 && cz < depth - 1 && loop < 5000 && !validPath)
+ ///
+ /// Scans the grid for cells that are not yet connected to the maze.
+ ///
+ /// The number of available (unused) cells.
+ private int GetAvailableCells()
{
- map[cx, cz] = 0;
- if (CountSquareMazeNeighbours(cx, cz) > 1)
- break;
-
- int rd = Random.Range(0, directions.Count);
- int nx = cx + directions[rd].x;
- int nz = cz + directions[rd].z;
- if (CountSquareNeighbours(nx, nz) < 2)
+ _notUsed.Clear();
+ for (int z = 1; z < depth - 1; z++)
{
- cx = nx;
- cz = nz;
- inWalk.Add(new MapLocation(cx, cz));
+ for (int x = 1; x < width - 1; x++)
+ {
+ if (CountSquareMazeNeighbours(x, z) == 0)
+ {
+ _notUsed.Add(new MapLocation(x, z));
+ }
+ }
}
- validPath = CountSquareMazeNeighbours(cx, cz) == 1;
-
- loop++;
+ return _notUsed.Count;
}
- if (validPath)
+ ///
+ /// Performs a random walk from an unused cell until it hits the existing maze.
+ ///
+ private void RandomWalk()
{
- map[cx, cz] = 0;
- Debug.Log("PathFound");
+ List inWalk = new List();
+ int rStartIndex = Random.Range(0, _notUsed.Count);
- foreach (MapLocation m in inWalk)
+ int cx = _notUsed[rStartIndex].x;
+ int cz = _notUsed[rStartIndex].z;
+
+ inWalk.Add(new MapLocation(cx, cz));
+
+ int loopCount = 0;
+ bool validPath = false;
+
+ while (cx > 0 && cx < width - 1 && cz > 0 && cz < depth - 1 && loopCount < 5000 && !validPath)
{
- map[m.x, m.z] = 2;
+ map[cx, cz] = Corridor;
+
+ if (CountSquareMazeNeighbours(cx, cz) > 1)
+ {
+ break;
+ }
+
+ int rd = Random.Range(0, directions.Count);
+ int nx = cx + directions[rd].x;
+ int nz = cz + directions[rd].z;
+
+ if (CountSquareNeighbours(nx, nz) < 2)
+ {
+ cx = nx;
+ cz = nz;
+ inWalk.Add(new MapLocation(cx, cz));
+ }
+
+ validPath = CountSquareMazeNeighbours(cx, cz) == 1;
+ loopCount++;
}
- inWalk.Clear();
- }
- else
- {
- foreach (MapLocation m in inWalk)
- map[m.x, m.z] = 1;
- inWalk.Clear();
- }
+ if (validPath)
+ {
+ map[cx, cz] = Corridor;
+ Debug.Log("Path Found");
+ foreach (MapLocation m in inWalk)
+ {
+ map[m.x, m.z] = Path;
+ }
+ inWalk.Clear();
+ }
+ else
+ {
+ foreach (MapLocation m in inWalk)
+ {
+ map[m.x, m.z] = Wall;
+ }
+ inWalk.Clear();
+ }
+ }
}
-
}