Table of Contents

Class SceneGameHost

Namespace
Axolotl2D.Scenes
Assembly
Axolotl2D.dll

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

game Game
scopeFactory IServiceScopeFactory
applicationLifetime IHostApplicationLifetime

Properties

CurrentScene

public BaseScene? CurrentScene { get; }

Property Value

BaseScene

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

cancellationToken CancellationToken

Indicates that the start process has been aborted.

Returns

Task

A Task that represents the asynchronous Start operation.

StopAsync(CancellationToken)

Triggered when the application host is performing a graceful shutdown.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the shutdown process should no longer be graceful.

Returns

Task

A Task that represents the asynchronous Stop operation.