Planeshift
psCharController Class Reference

Manages all control and movement related activities. More...

#include <pscharcontrol.h>

Public Member Functions

void CancelMouseLook ()
 
void CenterMouse (bool value)
 
const psControlGetMappedTrigger (psControl::Device device, uint button, uint32 mods)
 Get the triger mapped to a button, or NULL if none. More...
 
psMovementManagerGetMovementManager ()
 Provides access to the movement system. More...
 
const psControlGetTrigger (const char *name)
 Get a trigger by name. More...
 
bool HandleEvent (iEvent &event)
 Takes an event from psEngine, and dispatch it to either psControlManager or psMovementManager. More...
 
bool Initialize ()
 
bool IsReady ()
 
void LoadDefaultKeys ()
 Resets key mappings to defaults. More...
 
void LoadKeyFile ()
 loads the character-specific custom key mappings More...
 
bool MatchTrigger (const char *name, psControl::Device device, uint button, uint32 mods)
 Returns true if the trigger exists and is mapped to the specified combo. More...
 
 psCharController (iEventNameRegistry *eventname_reg)
 
bool RemapTrigger (const char *name, psControl::Device device, uint button, uint32 mods)
 Changes the button set for a trigger. Returns false if does not exist or button is taken. More...
 
 ~psCharController ()
 

Protected Member Functions

void CreateKeys ()
 Create all triggers. More...
 
bool LoadKeys (const char *file)
 Load all trigger mappings from file. More...
 
void SaveKeys ()
 Save custom trigger mappings. More...
 

Protected Attributes

psControlManager controls
 Key mappings. More...
 
csEventID event_mouseclick
 
psTriggerHandler handler
 Trigger functions. More...
 
psMovementManager movement
 Movement system. More...
 
bool ready
 Ready to process events? More...
 

Detailed Description

Manages all control and movement related activities.

Takes in events from psEngine and sends them to psControlManager and psMovementManager as needed. This serves as public access to the control system, and creates/loads/saves all control mappings.

Definition at line 229 of file pscharcontrol.h.

Constructor & Destructor Documentation

psCharController::psCharController ( iEventNameRegistry *  eventname_reg)
psCharController::~psCharController ( )

Member Function Documentation

void psCharController::CancelMouseLook ( )
void psCharController::CenterMouse ( bool  value)
void psCharController::CreateKeys ( )
protected

Create all triggers.

const psControl* psCharController::GetMappedTrigger ( psControl::Device  device,
uint  button,
uint32  mods 
)

Get the triger mapped to a button, or NULL if none.

psMovementManager* psCharController::GetMovementManager ( )
inline

Provides access to the movement system.

Definition at line 242 of file pscharcontrol.h.

const psControl* psCharController::GetTrigger ( const char *  name)

Get a trigger by name.

bool psCharController::HandleEvent ( iEvent &  event)

Takes an event from psEngine, and dispatch it to either psControlManager or psMovementManager.

bool psCharController::Initialize ( )
bool psCharController::IsReady ( )
void psCharController::LoadDefaultKeys ( )

Resets key mappings to defaults.

void psCharController::LoadKeyFile ( )

loads the character-specific custom key mappings

bool psCharController::LoadKeys ( const char *  file)
protected

Load all trigger mappings from file.

bool psCharController::MatchTrigger ( const char *  name,
psControl::Device  device,
uint  button,
uint32  mods 
)

Returns true if the trigger exists and is mapped to the specified combo.

bool psCharController::RemapTrigger ( const char *  name,
psControl::Device  device,
uint  button,
uint32  mods 
)

Changes the button set for a trigger. Returns false if does not exist or button is taken.

void psCharController::SaveKeys ( )
protected

Save custom trigger mappings.

Member Data Documentation

psControlManager psCharController::controls
protected

Key mappings.

Definition at line 270 of file pscharcontrol.h.

csEventID psCharController::event_mouseclick
protected

Definition at line 279 of file pscharcontrol.h.

psTriggerHandler psCharController::handler
protected

Trigger functions.

Definition at line 269 of file pscharcontrol.h.

psMovementManager psCharController::movement
protected

Movement system.

Definition at line 271 of file pscharcontrol.h.

bool psCharController::ready
protected

Ready to process events?

Definition at line 277 of file pscharcontrol.h.


The documentation for this class was generated from the following file: