wavelength 1.0.0
Loading...
Searching...
No Matches
StickEvent< kId > Class Template Reference

Input event of an analog stick position. More...

#include <stickevent.h>

Public Member Functions

 StickEvent ()=default
 Construct an event with unset members.
 StickEvent (unsigned char nPlayer, float fX, float fY)
 Construct an event.
 StickEvent (BinStream &stream)
 Construct the event from a recording.
void Save (BinStream &stream) const
 Record the player in one byte and each position in four bytes of the console's byte order.
void Load (BinStream &stream)
 Read the event Save() records.
float GetY () const
void SetY (float fY)
float GetX () const
void SetX (float fX)
unsigned char GetPlayer () const
void SetPlayer (unsigned char nPlayer)

Detailed Description

template<int kId>
class StickEvent< kId >

Input event of an analog stick position.

The RTTI includes the template with the arguments 2 and 6. The argument is the identifier of the serializable input command that records the event, and it makes each instance a distinct type. Every member is inline.

Template Parameters
kIdThe command identifier.

Constructor & Destructor Documentation

◆ StickEvent() [1/3]

template<int kId>
StickEvent< kId >::StickEvent ( )
default

Construct an event with unset members.

◆ StickEvent() [2/3]

template<int kId>
StickEvent< kId >::StickEvent ( unsigned char nPlayer,
float fX,
float fY )
inline

Construct an event.

Parameters
nPlayerThe player index.
fXThe horizontal position.
fYThe vertical position.

◆ StickEvent() [3/3]

template<int kId>
StickEvent< kId >::StickEvent ( BinStream & stream)
inlineexplicit

Construct the event from a recording.

Parameters
streamThe stream to read from.

Member Function Documentation

◆ Save()

template<int kId>
void StickEvent< kId >::Save ( BinStream & stream) const
inline

Record the player in one byte and each position in four bytes of the console's byte order.

Parameters
streamThe stream to write to.

◆ Load()

template<int kId>
void StickEvent< kId >::Load ( BinStream & stream)
inline

Read the event Save() records.

Parameters
streamThe stream to read from.

◆ GetY()

template<int kId>
float StickEvent< kId >::GetY ( ) const
inline
Returns
The vertical position.

◆ SetY()

template<int kId>
void StickEvent< kId >::SetY ( float fY)
inline
Parameters
fYThe vertical position.

◆ GetX()

template<int kId>
float StickEvent< kId >::GetX ( ) const
inline
Returns
The horizontal position.

◆ SetX()

template<int kId>
void StickEvent< kId >::SetX ( float fX)
inline
Parameters
fXThe horizontal position.

◆ GetPlayer()

template<int kId>
unsigned char StickEvent< kId >::GetPlayer ( ) const
inline
Returns
The player index.

◆ SetPlayer()

template<int kId>
void StickEvent< kId >::SetPlayer ( unsigned char nPlayer)
inline
Parameters
nPlayerThe player index.

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