World constructor

World({
  1. EngineContext? context,
  2. Iterable<ContextExtension> extensions = const [],
})

A world reading from context; when null, a fresh EngineContext with extensions installed, owned by this world.

Implementation

World({
  EngineContext? context,
  Iterable<ContextExtension> extensions = const [],
}) : assert(
       context == null || extensions.isEmpty,
       'Install extensions into the context given, not the world.',
     ),
     context = context ?? EngineContext(extensions: extensions),
     _ownsContext = context == null;