Scripting API
Scripting API
InputAction
Class in Abyss.Core, from Abyss.Core.
One action of a game's: what its code asks about — whether Jump was pressed, which way Move points.
public sealed class InputActionProperties
Id
public ulong Id { get; }Its identity, which stays with it as it is renamed and moved.
Name
public string Name { get; internal set; }What it is called, unique in its map.
Type
public ActionType Type { get; private set; }What its value is; see InputAction.ChangeType.
Map
public InputMap Map { get; }The map it is in.
Path
public string Path { get; }Its map's name and its: Player/Jump.
Bindings
public IReadOnlyList<InputBinding> Bindings { get; }What drives it, the strongest winning each frame.
Methods
Bind
public InputBinding Bind(InputBinding binding)Binds it to binding as well, given an identity of its own where it has none.
Parameters
binding
Returns The binding as it is kept.
Exceptions
ArgumentException: The binding does not fit the action, saying why, or its identity is taken.
Unbind
public bool Unbind(ulong id)Takes away the binding of identity id.
Parameters
id
Returns Whether it had one.
ChangeType
public int ChangeType(ActionType type)Makes it of type, taking away the bindings that do not fit it — a key from a vector, a stick from a button — which a binding of the right shape would have to replace.
Parameters
type
Returns How many bindings were taken away.
Replace
public bool Replace(InputBinding binding)Puts binding in the place of the binding of its identity.
Parameters
binding
Returns Whether it had a binding of that identity.
Exceptions
ArgumentException: The binding does not fit the action, saying why.
MoveBinding
public bool MoveBinding(ulong id, int to)Moves the binding of identity id to to among the bindings.
Parameters
idto
Returns Whether it moved.
DuplicateBinding
public InputBinding? DuplicateBinding(ulong id)A copy of the binding of identity id after it, an identity of its own; null for one it has not.
Parameters
id
ToString
public override string ToString()