initialize method

void initialize()

Initialize the world: every system in it is initialized (System.initialize), in the order they run. One added afterwards is initialized as it is added — also one added by another system's initialize.

Implementation

void initialize() {
  if (_initialized) return;
  // First, so a system added by one of these is initialized by addSystem.
  _initialized = true;

  for (final system in _running) {
    if (identical(system._addedTo, this)) system.initialize();
  }

  if (kDebugMode) {
    debugPrint('ECS World initialized with ${_systems.length} systems');
  }
}