App class final

Runs a World through named schedules.

Implemented types
Available extensions

Constructors

App({AccessConflictPolicy accessConflictPolicy = AccessConflictPolicy.warn, void onDiagnostic(String message)?, AppDiagnostics diagnostics = const AppDiagnostics()})
Creates an app with the built-in schedules registered.

Properties

accessConflictPolicy → AccessConflictPolicy
How the app reacts to access conflicts between unordered systems.
final
accessConflicts → List<AccessConflict>
Access conflicts detected across all schedules during start.
final
hashCode → int
The hash code for this object.
no setterinherited
onDiagnostic → void Function(String message)?
Optional sink for diagnostics (e.g. access-conflict warnings). When the policy is AccessConflictPolicy.warn, each conflict is passed here.
final
profiler → SystemProfiler?
The system profiler, or null when profiling is disabled. When enabled it is also inserted as a world resource so systems can read it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
world → World
The ECS world this app operates on.
final

Methods

addCleanup(FutureOr<void> cleanup()) → AppBuilder
Registers cleanup to run once when the app shuts down.
override
addEvent<T>({int? retainedUpdates = 8}) → AppBuilder
Registers an event channel for T.
override
addPlugin(Plugin plugin) → AppBuilder
Builds plugin into this app if it has not already been added.
override
addSchedule(ScheduleLabel label) → void
Registers an additional, custom schedule. Must be called before start.
addState<S extends Object>(S initial) → AppBuilder
Registers state S with initial.
override
addSystem(SystemDescriptor descriptor, {required ScheduleLabel schedule, List<SystemDescriptor> after = const <SystemDescriptor>[], List<SystemDescriptor> before = const <SystemDescriptor>[], RunCondition? runIf, SystemSet? inSet}) → AppBuilder
Registers descriptor in schedule.
override
addSystemAdapter(SystemAdapter adapter, {required ScheduleLabel schedule, required SystemLabel label, List<SystemLabel> after = const <SystemLabel>[], List<SystemLabel> before = const <SystemLabel>[], List<SystemLabel> independentOf = const <SystemLabel>[], RunCondition? runIf, SystemSet? inSet}) → AppBuilder
Registers adapter in schedule.
override
addSystems(ScheduleLabel schedule, List<SystemDescriptor> descriptors, {RunCondition? runIf, SystemSet? inSet, bool chained = false}) → AppBuilder

Available on AppBuilder, provided by the AppBuilderSystems extension

Registers descriptors in schedule.
applyStateTransitions() → void
Applies pending state transitions for every registered state machine.
configureSets(ScheduleLabel schedule, List<SystemSet> sets) → AppBuilder
Orders sets within schedule.
override
insertResource<T extends Object>(T resource) → AppBuilder
Inserts resource.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceResource<T extends Object>(T resource) → AppBuilder
Replaces or inserts resource.
override
runSchedule(ScheduleLabel label) → void
Runs the named schedule, then flushes deferred commands.
shutdown() → Future<void>
Runs shutdown, then attempts every cleanup and resource disposal even when a preceding stage fails. Reports failures in CleanupException.
start({void onStartupFlushed()?}) → void
Compiles and freezes all schedules, initializes every system adapter, runs the Schedules.startup schedule once, then runs each state machine's OnEnter(initial).
toString() → String
A string representation of this object.
inherited
updateEvents() → void
Advances all event channels, reclaiming consumed events. Call once per frame at a safe boundary (typically frame start).

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxStateTransitionPasses → const int
Chained-transition cap for one applyStateTransitions call.