resonance 1.0.1
Loading...
Searching...
No Matches
caughtphrasepacket.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "game/idableptr.h"
7
8class IBStream;
9class OBStream;
10class Player;
11
29public:
38
49 CaughtPhrasePacket(Player *pPlayer, unsigned int nTr, int nB)
50 : mPlayer(pPlayer), mTr(nTr), mB(nB) {
51 }
52
63 static Message *New();
64
72 virtual Message *Clone();
73
81 virtual int Type();
82
90 virtual const char *GetName() const;
91
99 virtual void PrintExtra(std::ostream &stream) const;
100
109 virtual void saveGuts(OBStream &stream) const;
110
118 virtual void restoreGuts(IBStream &stream);
119
126
132 unsigned int mTr;
133
139 int mB;
140};
141
int g_nCaughtPhrasePacketType
Identity that CaughtPhrasePacket::Type() reports.
virtual Message * Clone()
Produce a heap copy of this packet.
static Message * New()
Produce a default-constructed packet on the heap.
CaughtPhrasePacket()
Construct a packet with only the player reference and the Packet words set.
Definition caughtphrasepacket.h:36
CaughtPhrasePacket(Player *pPlayer, unsigned int nTr, int nB)
Report a phrase caught by a player.
Definition caughtphrasepacket.h:49
virtual void PrintExtra(std::ostream &stream) const
Write tr:, the track, b:, the bar, and a space to a diagnostic stream.
int mB
The phrase step, labelled b by PrintExtra().
Definition caughtphrasepacket.h:139
IDablePtr< Player > mPlayer
The player the phrase goes to.
Definition caughtphrasepacket.h:125
virtual void saveGuts(OBStream &stream) const
Write the Packet words, the player's identifier, the track, the bar, and the Packet word at +0x0c aga...
virtual void restoreGuts(IBStream &stream)
Read the fields back in place in the order saveGuts() wrote them.
unsigned int mTr
The track, labelled tr by PrintExtra().
Definition caughtphrasepacket.h:132
virtual const char * GetName() const
Report this packet's class name.
virtual int Type()
Report this packet's registered identity.
Input half of the byte stream interface.
Definition ibstream.h:36
Reference to a registered object by its identifier, resolved on first use.
Definition idableptr.h:30
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Output half of the byte stream interface.
Definition obstream.h:25
One participant in a session, local or remote.
Definition player.h:39
ToAllOtherGameSystemsPacket()
Route the packet with the pair 2 and 3.
Definition toallothergamesystemspacket.h:21