cmil::GameController Class Reference

#include <InputDevice.h>

Inheritance diagram for cmil::GameController:

Inheritance graph
[legend]
Collaboration diagram for cmil::GameController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GameController (const std::string &name, unsigned int axis, unsigned int buttons, unsigned int balls, unsigned int hats)
virtual InputDeviceclone () const
bool operator== (const GameController &controller) const

Public Attributes

tInputIndex< Axism_axes
 These are useful conversion indexes.
tInputIndex< Pressm_buttons
tInputIndex< Motionm_balls
tInputIndex< Hatm_hats

Detailed Description

Definition at line 243 of file InputDevice.h.


Constructor & Destructor Documentation

cmil::GameController::GameController ( const std::string &  name,
unsigned int  axis,
unsigned int  buttons,
unsigned int  balls,
unsigned int  hats 
)

Definition at line 598 of file InputDevice.cpp.

References m_axes, m_balls, m_buttons, m_hats, and cmil::InputDevice::m_inputs.

Referenced by clone().

00603                                 : InputDevice(name) {
00604     m_axes.fill_indexes (name, "axis",   axes,    m_inputs);
00605     m_buttons.fill_indexes (name, "button", buttons, m_inputs);
00606     m_balls.fill_indexes (name, "ball",   balls,   m_inputs);
00607     m_hats.fill_indexes (name, "hat",    hats,    m_inputs);
00608   }

Here is the caller graph for this function:


Member Function Documentation

InputDevice * cmil::GameController::clone (  )  const [virtual]

Devices must provide this function in order to achieve certain custom properties on on construction, this function is accessed by translators.

Reimplemented from cmil::InputDevice.

Definition at line 610 of file InputDevice.cpp.

References GameController(), cmil::InputDevice::getName(), Logger::log_debug(), m_axes, m_balls, m_buttons, m_hats, and cmil::InputDevice::setInputs().

00610                                            {
00611     log_debug("clone() ");
00613     InputDevice* clone = new GameController(getName(), m_axes.getSize(), m_buttons.getSize(), m_balls.getSize(), m_hats.getSize()); 
00614 
00616     clone->setInputs( *this );
00617 
00618     log_debug("clone() returning clone");
00619     return clone;
00620   };

Here is the call graph for this function:

bool cmil::GameController::operator== ( const GameController controller  )  const

Definition at line 622 of file InputDevice.cpp.

References cmil::InputDevice::getInputs(), cmil::InputDevice::getName(), Logger::log_debug(), m_axes, m_balls, m_buttons, m_hats, and cmil::InputDevice::m_inputs.

00622                                                                         { 
00623     log_debug("operator=="); 
00624     if ((m_axes == controller.m_axes) ||
00625       (m_buttons == controller.m_buttons) ||
00626       (m_balls   == controller.m_balls) ||
00627       (m_hats    == controller.m_hats)) {
00628     log_debug("operator== returning false due to member mismatch"); 
00629     return false;
00630     }
00631 
00632     return ((getName() == controller.getName()) && (m_inputs == controller.getInputs()));
00633   };

Here is the call graph for this function:


Member Data Documentation

tInputIndex<Axis> cmil::GameController::m_axes

These are useful conversion indexes.

Definition at line 254 of file InputDevice.h.

Referenced by clone(), GameController(), and operator==().

tInputIndex<Motion> cmil::GameController::m_balls

Definition at line 256 of file InputDevice.h.

Referenced by clone(), GameController(), and operator==().

tInputIndex<Press> cmil::GameController::m_buttons

Definition at line 255 of file InputDevice.h.

Referenced by clone(), GameController(), and operator==().

tInputIndex<Hat> cmil::GameController::m_hats

Definition at line 257 of file InputDevice.h.

Referenced by clone(), GameController(), and operator==().


The documentation for this class was generated from the following files:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:03 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo