arcade2d
Interface

WorldObjectDependencyResolver

world/dependencies.types.ts:109

Dependency resolver passed to WorldObjectComponent.resolveDependencies. Exposes both sibling lookups (other components on the same WorldObject) and cross-tier lookups against the parent World's components.

The cross-tier methods are the canonical way for object-scoped components to declare a dependency on world-scoped infrastructure — a graphics component reaching for the renderer, a physics body reaching for the simulation, an audio source reaching for the mixer.

Properties

readonly #
host: WorldObject

The WorldObject the component is being added to.

Methods

#
optionalFromWorld(type: DependencyComponentConstructor<T>): null | T

Same as WorldObjectDependencyResolver.requireFromWorld but returns null on miss or ambiguity.

Parameters

Returns

null | T
#
optionalSibling(type: DependencyComponentConstructor<T>): null | T

Same as WorldObjectDependencyResolver.requireSibling but returns null on miss or ambiguity instead of throwing.

Parameters

Returns

null | T
#
requireFromWorld(type: DependencyComponentConstructor<T>): T

Resolves a component on the parent World by type. This is the mechanism for object-scoped components that need to talk to world-scoped infrastructure.

Parameters

Returns

T
#
requireSibling(type: DependencyComponentConstructor<T>): T

Resolves a sibling component on the same host by type.

Parameters

Returns

T
ESC