equals function

bool equals(
  1. Node? p1,
  2. Node? p2
)

Implementation

bool equals(Node? p1, Node? p2) {
  return p1?.x == p2?.x && p1?.y == p2?.y;
}