getPath method

List<ECSBase<T>> getPath()
inherited

Returns the path from the root down to this one, inclusive.

Implementation

List<ECSBase<T>> getPath() {
  List<ECSBase<T>> path = [];
  ECSBase<T>? current = this;
  while (current != null) {
    path.insert(0, current);
    final parent = current.parent;
    if (parent != this) {
      current = parent;
    } else {
      break;
    }
  }
  return path;
}