addDependency method

bool addDependency(
  1. ActorComponent a,
  2. ActorComponent b
)

Implementation

bool addDependency(ActorComponent a, ActorComponent b) {
  List<ActorComponent>? dependents = b.dependents;
  if (dependents == null) {
    b.dependents = dependents = <ActorComponent>[];
  }
  if (dependents.contains(a)) {
    return false;
  }
  dependents.add(a);
  return true;
}