Skip to main content

ControllerActionProxy

A class in Root.Township, the global namespace.

A stand-in controller action that forwards the state and events of whichever ControllerAction it is linked to, and can be switched off on its own. Client input.

Constructors​

MemberWhat it is
ControllerActionProxy()Creates a ControllerActionProxy with default values.

Fields​

1 private and internal field
MemberWhat it is
private bool isEnabledBacking field for IsEnabled.

Properties​

MemberWhat it is
bool IsEnabled { get; set; }When false, Started and Ended are not forwarded and the bool conversion is false. True by default.
bool State { get; }The linked action's current state, or false when nothing is linked. Ignores IsEnabled.
ControllerActionType Type { get; set; }Which controller action type this proxy stands for.
1 private and internal property
MemberWhat it is
private ControllerAction LinkedControllerAction { get; set; }The real controller action this proxy listens to, set by LinkToControllerAction.

Events​

MemberWhat it is
event ControllerActionEventHandler DisabledRaised when IsEnabled changes to false.
event ControllerActionEventHandler EnabledRaised when IsEnabled changes to true.
event ClickedEndEventHandler EndedForwarded from the linked action when it ends, only while this proxy is enabled.
event ClickedEventHandler StartedForwarded from the linked action when it starts, only while this proxy is enabled.

Methods​

MemberWhat it is
void LinkToControllerAction(ControllerAction controllerAction)Links the proxy to a controller action, unlinking any previous one first.
static bool op_Implicit(ControllerActionProxy input)Converts to bool: true only when the linked action is active and the proxy is enabled.
void UnlinkFromAction()Stops following the linked action.
2 private and internal methods
MemberWhat it is
private void InvokeEnded(PlayerInput input, bool isDisabling)Forwards the linked action's Ended event if the proxy is enabled.
private void InvokeStarted(PlayerInput input)Forwards the linked action's Started event if the proxy is enabled.

Used in​

Members of other types that take, return or hold a ControllerActionProxy: