C4 Engine
C4 Engine API Documentation

class Action

Defined in:  C4Input.h
The Action class represents an action that can be triggered by an input control.
Definition

class Action : public LinkTarget<Action>, public ListElement<Action>, public Memory<InputDevice>

Member Functions
Action::GetActionType Returns the type of action.
Action::HandleEngage Called when an associated input control is engaged.
Action::HandleDisengage Called when an associated input control is disengaged.
Action::HandleDirectionalUpdate Called when an associated input control has new directional data.
Action::HandleAxisUpdate Called when an associated input control has new axis data.
Action::HandleSliderUpdate Called when an associated input control has new slider data.
Constructor

explicit Action(ActionType type);

Parameters
type The type of the action.
Description
An application typically creates several Action objects representing the various actions that a player can perform in a game. Examples of actions are forward and backward movements and firing a weapon. Once an action object is created, it must be registered with the Input Manager by calling the InputMgr::AddAction function.

An action object is assigned to an input control by calling the InputControl::SetInputControlAction function. One action object may be assigned to multiple input controls. After an action object is assigned to an input control, it can receive calls to its virtual member functions in response to user input to that input control.

Each action must have a unique type. An application can choose any 32-bit identifier that does not consist entirely of uppercase letters and numbers to pass in the type paramater of the Action constructor.
Base Classes
LinkTarget<Action> Used internally by the Input Manager.
ListElement<Action> Used internally by the Input Manager.
Memory<InputDevice> Actions are allocated in a dedicated heap.
See Also

InputControl

InputMgr::AddAction

InputMgr::RemoveAction