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

Input event of a button press that names only the player. More...

#include <btnevent.h>

Public Member Functions

 BtnEvent ()=default
 Construct an event with an unset player.
 BtnEvent (BinStream &stream)
 Construct the event from a recording.
void Save (BinStream &stream) const
 Record the player in one byte.
void Load (BinStream &stream)
 Read the event Save() records.
unsigned char GetPlayer () const
void SetPlayer (unsigned char nPlayer)

Detailed Description

template<int kId>
class BtnEvent< kId >

Input event of a button press that names only the player.

The RTTI includes the template with the arguments 3, 4, 5, 8, 9, and 10. 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

◆ BtnEvent() [1/2]

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

Construct an event with an unset player.

◆ BtnEvent() [2/2]

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

Construct the event from a recording.

Parameters
streamThe stream to read from.

Member Function Documentation

◆ Save()

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

Record the player in one byte.

Parameters
streamThe stream to write to.

◆ Load()

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

Read the event Save() records.

Parameters
streamThe stream to read from.

◆ GetPlayer()

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

◆ SetPlayer()

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

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