Remarks
load and unload only queue a change; apply makes the queued changes,
one after the other, at a time no system runs.
Constructors
Constructor
new SceneManager(Defined in: modules/scene/src/scene-manager.ts:56scenes?):SceneManager
Parameters
scenes?
Readonly<Record<string, SceneClass<never>>> = {}
The game’s scene classes by id. A scene missing from it is known by its
class name.
Returns
SceneManager
Properties
vars
Defined in: modules/scene/src/scene-manager.ts:43readonlyvars:SceneVarsStore
Accessors
chain
Get Signature
get chain(): LoadedSceneInfo[]
Defined in: modules/scene/src/scene-manager.ts:79
The loaded scenes’ ids and params, root first.
Returns
LoadedSceneInfo[]
current
Get Signature
get current():Defined in: modules/scene/src/scene-manager.ts:89 The scene loaded deepest.AnyScene|undefined
Returns
AnyScene | undefined
knownIds
Get Signature
get knownIds(): string[]
Defined in: modules/scene/src/scene-manager.ts:74
Ids of the scenes that can be loaded by id.
Returns
string[]
loaded
Get Signature
get loaded(): AnyScene[]
Defined in: modules/scene/src/scene-manager.ts:94
The loaded scenes, root first.
Returns
AnyScene[]
Methods
apply()
apply(Defined in: modules/scene/src/scene-manager.ts:132 Makes the queued changes, including those queued by the scenes’ hooks.ctx):Promise<void>
Parameters
ctx
Context
Handed to the hooks of a change queued without a context.
Returns
Promise<void>
Throws
The first error of a hook or of a move: that request’s promise is rejected too.byId()
byId(Defined in: modules/scene/src/scene-manager.ts:69 The scene class of an id: from theid):SceneClass<never> |undefined
scenes given, else a scene class seen so far.
Parameters
id
string
Returns
SceneClass<never> | undefined
idOf()
idOf(Defined in: modules/scene/src/scene-manager.ts:64 A scene class’s id: its key in thetype):string
scenes given, else its class name.
Parameters
type
SceneClass<never>
Returns
string
idOfScene()
idOfScene(Defined in: modules/scene/src/scene-manager.ts:84 The id of a loaded scene instance.scene):string|undefined
Parameters
scene
Scene<never>
Returns
string | undefined
isLoaded()
isLoaded(Defined in: modules/scene/src/scene-manager.ts:98type):boolean
Parameters
type
SceneClass
Returns
boolean
load()
load<Defined in: modules/scene/src/scene-manager.ts:107 Queues a move toTParams>(ctx,type,options?):Promise<void>
type.
Type Parameters
TParams
TParams
Parameters
ctx
Context | undefined
type
SceneClass<TParams>
options?
LoadOptions<TParams>
Returns
Promise<void>
A promise resolved once the move is made, rejected if it fails.
reset()
reset(): void
Defined in: modules/scene/src/scene-manager.ts:146
Drops the loaded scenes and the vars, without calling the hooks.
Returns
void
unload()
unload(Defined in: modules/scene/src/scene-manager.ts:122 Queues the unload ofctx,type):Promise<void>
type and of the scenes loaded under it. Nothing
happens when it is not loaded by then.
Parameters
ctx
Context | undefined
type
SceneClass
Returns
Promise<void>