Class SceneGameHost
Hosts the game and owns the active scene DI scopes.
public sealed class SceneGameHost : IGameHost, IHostedService
- Inheritance
-
SceneGameHost
- Implements
- Inherited Members
Constructors
SceneGameHost(Game, IServiceScopeFactory, AxolotlModuleRegistry, IHostApplicationLifetime)
Hosts the game and owns the active scene DI scopes.
public SceneGameHost(Game game, IServiceScopeFactory scopeFactory, AxolotlModuleRegistry moduleRegistry, IHostApplicationLifetime applicationLifetime)
Parameters
gameGamescopeFactoryIServiceScopeFactorymoduleRegistryAxolotlModuleRegistryapplicationLifetimeIHostApplicationLifetime
Properties
CurrentScene
The topmost active scene.
public BaseScene? CurrentScene { get; }
Property Value
SceneCount
public int SceneCount { get; }
Property Value
Methods
ChangeScene(string)
Changes to a package scene registered under a stable ID.
public void ChangeScene(string id)
Parameters
idstring
ChangeScene(Type)
Changes to a scene type discovered at runtime and clears every active layer.
public void ChangeScene(Type type)
Parameters
typeType
ChangeScene<T>()
public void ChangeScene<T>() where T : BaseScene
Type Parameters
T
PopScene()
Removes and disposes the top scene, preserving the base scene.
public bool PopScene()
Returns
PushScene(string, SceneLayerOptions?)
Pushes a package scene registered under a stable ID.
public void PushScene(string id, SceneLayerOptions? options = null)
Parameters
idstringoptionsSceneLayerOptions?
PushScene(Type, SceneLayerOptions?)
Pushes a scene type discovered at runtime.
public void PushScene(Type type, SceneLayerOptions? options = null)
Parameters
typeTypeoptionsSceneLayerOptions?
PushScene<T>(SceneLayerOptions?)
Pushes an overlay scene that blocks lower updates while drawing over them.
public void PushScene<T>(SceneLayerOptions? options = null) where T : BaseScene
Parameters
optionsSceneLayerOptions?
Type Parameters
T
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the start process has been aborted.
Returns
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the shutdown process should no longer be graceful.