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
servicesIServiceCollectionService Collection
Returns
AddScene<T>(IServiceCollection)
Registers a game scene.
public static void AddScene<T>(this IServiceCollection services) where T : BaseScene
Parameters
servicesIServiceCollectionService provider
Type Parameters
TScene 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
servicesIServiceCollection
UseAudioPlayer(IServiceCollection)
Registers the Audio Player.
public static void UseAudioPlayer(this IServiceCollection services)
Parameters
servicesIServiceCollectionService 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
servicesIServiceCollectionService Collection
enableDebugOverlayboolWhether to draw in-game runtime inspection.
Type Parameters
TGame 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
servicesIServiceCollectionService Collection
enableDebugOverlayboolWhether to draw in-game runtime inspection.
Type Parameters
TGame to host
Exceptions
- InvalidOperationException
Can not register multiple IGameHost services.