allInstancesWhere static method

List<Subsystem> allInstancesWhere(
  1. bool predicate(
    1. Subsystem instance
    )
)

All active subsystem instances across every registered SubsystemTypeDesc matching predicate — not scoped to a single type.

Implementation

static List<Subsystem> allInstancesWhere(bool Function(Subsystem instance) predicate) {
  final instances = <Subsystem>[];
  for (final registry in _registriesByTypeDesc.values) {
    for (final singleton in registry.allInstances) {
      if (predicate(singleton)) {
        instances.add(singleton);
      }
    }
  }
  return instances;
}