Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CheckAndEnqueueNode(int x, int y, List<Node> nodesToCheck, int distance)
- {
- if (IsNodeInGridBounds(x, y))
- {
- //Check if node is walkable, not queued for check and unchecked
- if (grid[x, y].walkable && !grid[x, y].isEnqueued && !grid[x, y].check)
- {
- //Enqueue node and set its distance
- nodesToCheck.Add(grid[x, y]);
- grid[x, y].isEnqueued = true;
- grid[x, y].distance = distance + 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement