Engine::InputReport Class Reference

A message about a players control over their car or the menu. More...

#include <InputReport.h>

List of all members.

Public Types

 RT_CHANGE_ACCEL
 Change to accelerator / break amount.
 RT_CHANGE_SLIDE
 Change to sideways crabbing control.
 RT_CHANGE_STEERING
 Change to steering wheel angle.
 RT_MENU_UP
 select item above in menus
 RT_MENU_DOWN
 select item below in menus
 RT_MENU_LEFT
 select item to the left in menus
 RT_MENU_RIGHT
 select item to the right in menus
 RT_MENU_SELECT
 go forwards in menus, pick the selected option
 RT_MENU_BACK
 go back to the previous menu
 RT_DISCONNECT
 Device unplugged / switched off.
 RT_BATTERY_LOW
 Battery level warning, emmited by Wiimotes.
 RT_MAX
 Maximum value for a report type.
enum  ReportType {
  RT_CHANGE_ACCEL, RT_CHANGE_SLIDE, RT_CHANGE_STEERING, RT_MENU_UP,
  RT_MENU_DOWN, RT_MENU_LEFT, RT_MENU_RIGHT, RT_MENU_SELECT,
  RT_MENU_BACK, RT_DISCONNECT, RT_BATTERY_LOW, RT_MAX
}

Public Member Functions

 InputReport (const InputDevice *input_device, ReportType type, int value=0)
 Create a report.
virtual ~InputReport ()
ReportType get_report_type () const
 get the report type of this report
int get_value () const
 Get a value attached to this report.
std::set< InputDevice
* >::iterator 
get_input_device () const
 Get the InputHandler's iterator of the input_device that created the report.

Private Attributes

std::set< InputDevice
* >::iterator 
input_device
ReportType type
int value


Detailed Description

A message about a players control over their car or the menu.

Abstracted away is weather the player is human or AI, what input device a human player is using, what the controller layout is like, and if certain responses are analogue (joy stick or accellerometer) or digital (direction pad, keys or buttons).

Definition at line 26 of file InputReport.h.


Member Enumeration Documentation

enum Engine::InputReport::ReportType

Enumerator:
RT_CHANGE_ACCEL  Change to accelerator / break amount.
RT_CHANGE_SLIDE  Change to sideways crabbing control.
RT_CHANGE_STEERING  Change to steering wheel angle.
RT_MENU_UP  select item above in menus
RT_MENU_DOWN  select item below in menus
RT_MENU_LEFT  select item to the left in menus
RT_MENU_RIGHT  select item to the right in menus
RT_MENU_SELECT  go forwards in menus, pick the selected option
RT_MENU_BACK  go back to the previous menu
RT_DISCONNECT  Device unplugged / switched off.
RT_BATTERY_LOW  Battery level warning, emmited by Wiimotes.
RT_MAX  Maximum value for a report type.

Definition at line 31 of file InputReport.h.


Constructor & Destructor Documentation

Engine::InputReport::InputReport ( const InputDevice input_device,
ReportType  type,
int  value = 0 
)

Create a report.

Input devices should report events as soon as they can.

Parameters:
input_device the input device that caused the event. Important for establishing which player this notification applies to.
type ReportType indicating what has changed.
value number indicating new strength for type. It should range from -32767 to +32767, where 0 is neutral. It is ignored for some values of type.

Definition at line 18 of file InputReport.cpp.

Engine::InputReport::~InputReport (  )  [virtual]

Definition at line 25 of file InputReport.cpp.


Member Function Documentation

std::set< InputDevice * >::iterator Engine::InputReport::get_input_device (  )  const

Get the InputHandler's iterator of the input_device that created the report.

Definition at line 39 of file InputReport.cpp.

InputReport::ReportType Engine::InputReport::get_report_type (  )  const

get the report type of this report

Returns:
the ReportType enum telling what the report is indicating.

Definition at line 29 of file InputReport.cpp.

int Engine::InputReport::get_value (  )  const

Get a value attached to this report.

It is only used for reports of type RT_CHANGE_ACCEL, RT_CHANGE_SLIDE, and RT_CHANGE_STEERING.

Returns:
Value associated with this report. It ranges from -32767 to +32767, where 0 is neutral.

Definition at line 34 of file InputReport.cpp.


Member Data Documentation

std::set<InputDevice *>::iterator Engine::InputReport::input_device [private]

Definition at line 99 of file InputReport.h.

ReportType Engine::InputReport::type [private]

Definition at line 100 of file InputReport.h.

int Engine::InputReport::value [private]

Definition at line 101 of file InputReport.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.