things have been optimized, time for DFS

This commit is contained in:
Simon O'Shea
2023-08-09 11:39:18 -04:00
parent 69e1551b26
commit b3b4dacf19
3 changed files with 51 additions and 36 deletions
@@ -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()