Skip to content

KernelAPI reference

Class HostBuilderExtensions

Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Composing a game for every platform

The game’s side of a HostBuilder: choosing the game, the platforms a host offers and changes to the platform request. A game’s Configure entry point calls these; every host (desktop, browser, phones, tests) reads them through GameHost.

C#
public static class HostBuilderExtensions

Inheritance

object ← HostBuilderExtensions

Methods

ConfigureRequest(HostBuilder, Func<PlatformRequest, PlatformRequest>)

Changes the platform request before the platform is built (an audio device or input sources of the host’s own, PlatformRequest); changes apply in the order added.

C#
public static HostBuilder ConfigureRequest(this HostBuilder host, Func<PlatformRequest, PlatformRequest> change)

Parameters

host HostBuilder

change Func<PlatformRequest, PlatformRequest>

Returns

HostBuilder

The builder, for chaining.

Platforms(HostBuilder)

The platforms the host offers, in order of preference (filled with the host’s own before the game’s Configure runs; add a profile to offer it with –platform).

C#
public static PlatformCatalog Platforms(this HostBuilder host)

Parameters

host HostBuilder

Returns

PlatformCatalog

SaveStore(HostBuilder, string)

A save store for gameId on the composition’s medium (Storage), else the platform’s default (DefaultStorage).

C#
public static SaveStore SaveStore(this HostBuilder host, string gameId)

Parameters

host HostBuilder

gameId string

Returns

SaveStore

UseGame(HostBuilder, Func<Game>)

The game this composition runs: create builds a new one for every run.

C#
public static HostBuilder UseGame(this HostBuilder host, Func<Game> create)

Parameters

host HostBuilder

create Func<Game>

Returns

HostBuilder

The builder, for chaining.

UsePlatforms(HostBuilder, PlatformCatalog)

Replaces the platforms the host offers.

C#
public static HostBuilder UsePlatforms(this HostBuilder host, PlatformCatalog catalog)

Parameters

host HostBuilder

catalog PlatformCatalog

Returns

HostBuilder

The builder, for chaining.