C4 Engine
C4 Engine API Documentation

class Controller

Defined in:  C4Controller.h
The Controller class manages a dynamic node in a world.
Definition

class Controller : public HashTableElement<Controller>, public ListElement<Controller>, public Observable<Controller, EventType>,

public Packable, public Configurable, public Registrable<Controller, ControllerRegistration>

Member Functions
Controller::NewController Constructs a new controller of a particular type.
Controller::GetControllerType Returns the controller type.
Controller::GetControllerFlags Returns the controller flags.
Controller::SetControllerFlags Sets the controller flags.
Controller::GetControllerIndex Returns the World Manager controller index.
Controller::GetTargetNode Returns the node to which a controller is attached.
Controller::ValidNode Returns a boolean value indicating whether the controller can be assigned to a particular node.
Controller::InstanceExtractable Returns a boolean value indicating whether the controller's target node should be extracted from an instanced world.
Controller::ActivateController Called when a controller is activated by some kind of trigger.
Controller::DeactivateController Called when the trigger node that activated a controller is deactivated.
 
Controller::PreprocessController Performs any preprocessing that a controller needs to do before being used in a world.
Controller::WakeController Wakes a sleeping controller.
Controller::SleepController Puts a controller to sleep.
Controller::MoveController Performs any per-frame movement or processing that a controller needs to do.
Controller::UpdateController Performs any processing that must be done before the node to which a controller is attached is rendered.
Controller::InvalidateController Indicates that a controller needs to be updated.
 
Controller::CreateMessage Called to create a cotroller-defined message.
Controller::ReceiveMessage Called to process a controller-defined message.
Controller::SendInitialStateMessages Called to send messages containing the controller's state to a new player.
Controller::HandleInteractionEvent Called to handle an event for an interactive node.
Constructor

Controller(ControllerType type = kControllerGeneric);

Parameters
type The controller type.
Description
The Controller class is the general mechanism through which dynamic nodes are managed in a world. Any node that moves for almost any reason is controlled by a specialized subclass of the Controller class. The Controller class also serves as the point of communication for nodes that need to be synchronized in a multiplayer environment.
Base Classes
HashTableElement<Controller> Used internally by the World Manager.
ListElement<Controller> Used internally by the World Manager.
Observable<Controller, EventType> Controllers can post events that are handled by observers.
Packable Controllers can be packed for storage in resources.
Configurable Controllers can define configurable parameters that are exposed as user interface widgets in the World Editor.
Registrable<Controller, ControllerRegistration> Custom controller types can be registered with the engine.
See Also

ControllerReg