resonance 1.0.1
Loading...
Searching...
No Matches
Gem Class Reference

Gem event a GemPacket reports. More...

#include <gem.h>

Collaboration diagram for Gem:

Public Member Functions

void saveGuts (OBStream &stream) const
 Write the five values to a stream.
void restoreGuts (IBStream &stream)
 Read the five values back from a stream.
void Print (std::ostream &stream) const
 Write the five values to a diagnostic stream.

Public Attributes

int mGem
int mTrans
int mBar
Sch::Tick mLoc
Player * mPlayer

Detailed Description

Gem event a GemPacket reports.

The five members form a subobject of GemPacket at +0x14, because the three routines below receive packet + 0x14 as their object and address it from zero. The class has no descriptor, allocation tag, or literal. Its name comes from the debugging symbols of the North American demo release. The demo's saveGuts() and Print() have the same instructions as this class's saveGuts() and Print(). The name of each member is attested, from the label Print() writes ahead of it.

Every member is public, because the three routines are the only code in the image that refers to the subobject and no accessor exists.

Member Function Documentation

◆ saveGuts()

void Gem::saveGuts ( OBStream & stream) const

Write the five values to a stream.

The player arrives on the wire as its identifier rather than as a pointer, and the value written is mPlayer->mPlayerId.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001a2560
Ghidra address:
PAL: 0x001a82c8

◆ restoreGuts()

void Gem::restoreGuts ( IBStream & stream)

Read the five values back from a stream.

Reads mGem, mTrans, and mBar, calls Sch::Tick::restoreGuts() for mLoc, and reads the identifier into a local IDablePtr<Player>. Resolving it differs from IDablePtr's own conversion in one respect. An identifier of -1 yields a null pointer here, while the conversion the packets' Print() bodies expand would index the table at -1. The other two cases agree: kIDableUnregistered yields NullPlayer::sInstance and any other value indexes the IDable<Player> table.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x001a2630
Ghidra address:
PAL: 0x001a8398

◆ Print()

void Gem::Print ( std::ostream & stream) const

Write the five values to a diagnostic stream.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x001a2ce0
Ghidra address:
PAL: 0x001a8a48

Member Data Documentation

◆ mGem

int Gem::mGem

Labelled gem: . +0x00

◆ mTrans

int Gem::mTrans

Labelled trans:. +0x04

◆ mBar

int Gem::mBar

Labelled bar:. +0x08

◆ mLoc

Sch::Tick Gem::mLoc

Labelled loc:. +0x0c

◆ mPlayer

Player* Gem::mPlayer

Labelled pid:, written as its identifier. +0x10


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