sort method

Implementation

List<ActorComponent?>? sort(ActorComponent root) {
  final order = <ActorComponent?>[];
  if (!_visit(root, order)) {
    return null;
  }
  return order;
}