Table of Contents

Class Hosting

Namespace
Axolotl2D
Assembly
Axolotl2D.dll

Presents methods for injecting game-related services into a Host.

public static class Hosting
Inheritance
Hosting
Inherited Members

Methods

AddAxolotl2D(IServiceCollection)

Registers the Asset Manager.

public static IServiceCollection AddAxolotl2D(this IServiceCollection services)

Parameters

services IServiceCollection

Service Collection

Returns

IServiceCollection

AddScene<T>(IServiceCollection)

Registers a game scene.

public static void AddScene<T>(this IServiceCollection services) where T : BaseScene

Parameters

services IServiceCollection

Service provider

Type Parameters

T

Scene to register.

Exceptions

InvalidOperationException

Tried to register an abstract class or the BaseScene class itself.

UseAssetManager(IServiceCollection)

Registers typed asset loading. Prefer AddAxolotl2D(IServiceCollection) for new applications.

public static void UseAssetManager(this IServiceCollection services)

Parameters

services IServiceCollection

UseAudioPlayer(IServiceCollection)

Registers the Audio Player.

public static void UseAudioPlayer(this IServiceCollection services)

Parameters

services IServiceCollection

Service provider

UseSceneManagerGameHost<T>(IServiceCollection, bool)

Registers a game host that hosts the game using scenes.

public static void UseSceneManagerGameHost<T>(this IServiceCollection services, bool enableDebugOverlay = false) where T : Game

Parameters

services IServiceCollection

Service Collection

enableDebugOverlay bool

Whether to draw in-game runtime inspection.

Type Parameters

T

Game to host

Exceptions

InvalidOperationException

Can not register multiple IGameHost services.

UseSimpleGameHost<T>(IServiceCollection, bool)

Registers a game host that simply hosts the game.

public static void UseSimpleGameHost<T>(this IServiceCollection services, bool enableDebugOverlay = false) where T : Game

Parameters

services IServiceCollection

Service Collection

enableDebugOverlay bool

Whether to draw in-game runtime inspection.

Type Parameters

T

Game to host

Exceptions

InvalidOperationException

Can not register multiple IGameHost services.