things have been optimized, time for DFS
This commit is contained in:
@@ -20,8 +20,8 @@ public class nMain : MonoBehaviour
|
||||
|
||||
// Coordinates for pathfinding
|
||||
public Vector2Int agent = new Vector2Int();
|
||||
public List<Vector2Int> obstacles = new List<Vector2Int>();
|
||||
public List<Vector2Int> samples = new List<Vector2Int>();
|
||||
public HashSet<Vector2Int> obstacles = new HashSet<Vector2Int>();
|
||||
public HashSet<Vector2Int> samples = new HashSet<Vector2Int>();
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -108,8 +108,8 @@ public class nMain : MonoBehaviour
|
||||
{
|
||||
world.reset();
|
||||
agent = new Vector2Int();
|
||||
obstacles = new List<Vector2Int>();
|
||||
samples = new List<Vector2Int>();
|
||||
obstacles = new HashSet<Vector2Int>();
|
||||
samples = new HashSet<Vector2Int>();
|
||||
}
|
||||
|
||||
public void StartAlgorithm()
|
||||
|
||||
Reference in New Issue
Block a user