27 StickEvent(
unsigned char nPlayer,
float fX,
float fY) : mPlayer(nPlayer), mX(fX), mY(fY) {
45 const unsigned char nPlayer = mPlayer;
46 stream.
Write(&nPlayer,
sizeof(nPlayer));
59 stream.
Read(&mPlayer,
sizeof(mPlayer));
95 unsigned char mPlayer;
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
void ReadEndian(void *pData, int nBytes)
Read a value of 2, 4, 8, or 16 bytes, reversing its bytes unless the stream is little endian.
virtual void Read(void *pData, int nBytes)=0
Read bytes.
virtual void Write(const void *pData, int nBytes)=0
Write bytes.
void WriteEndian(const void *pData, int nBytes)
Write a value of 2, 4, 8, or 16 bytes, reversing its bytes unless the stream is little endian.
void Load(BinStream &stream)
Read the event Save() records.
Definition stickevent.h:58
StickEvent(BinStream &stream)
Construct the event from a recording.
Definition stickevent.h:35
unsigned char GetPlayer() const
Definition stickevent.h:85
void SetX(float fX)
Definition stickevent.h:80
StickEvent(unsigned char nPlayer, float fX, float fY)
Construct an event.
Definition stickevent.h:27
float GetY() const
Definition stickevent.h:65
StickEvent()=default
Construct an event with unset members.
void SetY(float fY)
Definition stickevent.h:70
float GetX() const
Definition stickevent.h:75
void Save(BinStream &stream) const
Record the player in one byte and each position in four bytes of the console's byte order.
Definition stickevent.h:44
void SetPlayer(unsigned char nPlayer)
Definition stickevent.h:90