gai-godot-games/pathfinding-algorithms/scenes/custom-solver/PathfindingResult.gd

22 lines
560 B
GDScript
Raw Normal View History

2024-11-12 15:39:09 +01:00
class_name PathfindingResult
extends Node
var path: Array[NavigationNode] = []
var next_position: Vector2 = Vector2.ZERO
var is_next_target: bool = false
func _init() -> void:
path = []
next_position = Vector2.ZERO
is_next_target = false
func is_identical_to(other: PathfindingResult) -> bool:
if path.size() != other.path.size():
return false
for i in range(path.size()):
if path[i] != other.path[i]:
return false
if next_position != other.next_position:
return false
return true