Controller System
C4Controller.h

class Controller

The Controller class manages a dynamic node in a world.
Definition

class Controller : public ListElement<Controller>, public Registrable<Controller, ControllerRegistration>, public Packable, public Configurable

Member Functions
Controller::New Constructs a new controller of a particular type.
Controller::GetControllerType Returns the controller type.
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::Activate Called when a controller is activated by some kind of trigger.
Controller::Deactivate Called when the Trigger node that activated a controller is deactivated.
 
Controller::Preprocess Performs any preprocessing that a controller needs to do before being used in a world.
Controller::Sleep Puts a controller to sleep.
Controller::Wake Wakes a sleeping controller.
Controller::Move Performs any per-frame movement or processing that a controller needs to do.
Controller::Update Performs any processing that must be done before the node to which a controller is attached is rendered.
Controller::EnterZone Called when the node to which a controller is attached enters a zone.
Controller::ExitZone Called when the node to which a controller is attached exits a zone.
Controller::SetDetailLevel Called when the detail level for the target node changes.
Controller::Invalidate Indicates that a controller needs to be updated.
 
Controller::ConstructMessage Called to construct 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
ListElement<Controller> Used internally by the World Manager.
Registrable<Controller, ControllerRegistration> Custom controller types can be registered with the engine.
Packable Controllers can be packed for storage in resources.
Configurable Controllers can define configurable parameters that are exposed as user interface elements in the World Editor.
See Also
ControllerReg