Class SceneGameHost
Hosts the game and owns the active scene DI scope.
public sealed class SceneGameHost : IGameHost, IHostedService
- Inheritance
-
SceneGameHost
- Implements
- Inherited Members
Constructors
SceneGameHost(Game, IServiceScopeFactory, IHostApplicationLifetime)
Hosts the game and owns the active scene DI scope.
public SceneGameHost(Game game, IServiceScopeFactory scopeFactory, IHostApplicationLifetime applicationLifetime)
Parameters
gameGamescopeFactoryIServiceScopeFactoryapplicationLifetimeIHostApplicationLifetime
Properties
CurrentScene
public BaseScene? CurrentScene { get; }
Property Value
Methods
ChangeScene<T>()
public void ChangeScene<T>() where T : BaseScene
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.