Skip to content

InputAPI reference

Class PlayerInput

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.dll
Guide: Input

One local player: an action map of their own (Map) read from the devices paired with them.

C#
public sealed class PlayerInput

Inheritance

object ← PlayerInput

Properties

Devices

The devices paired with this player, in id order. Empty for player 1 until something is paired with them.

C#
public IReadOnlyList<DeviceId> Devices { get; }

Property Value

IReadOnlyList<DeviceId>

Index

The player’s position, 0-based: player 1 is 0.

C#
public int Index { get; }

Property Value

int

Map

The player’s actions, sampled once per update from their devices.

C#
public InputMap Map { get; }

Property Value

InputMap

Owns

Whether this player hears a device (see OwnerOf).

C#
public Func<DeviceId, bool> Owns { get; }

Property Value

Func<DeviceId, bool>

Methods

Pair(DeviceId)

Pairs device with this player, taking it from whoever had it.

C#
public PlayerInput Pair(DeviceId device)

Parameters

device DeviceId

Returns

PlayerInput

Unpair(DeviceId)

Ends the pairing of device with this player; false when it was not paired with them.

C#
public bool Unpair(DeviceId device)

Parameters

device DeviceId

Returns

bool