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

One gem of the phrase at one song position. More...

#include <phrase.h>

Collaboration diagram for Phrase::Gem:

Public Member Functions

bool operator< (const Gem &other) const
 Order two gems by position.
bool operator== (const Gem &other) const
 Compare two gems member by member, in declaration order.

Public Attributes

Sch::Tick mPosition
int mGem
int mTrans

Detailed Description

One gem of the phrase at one song position.

The record is twelve bytes. PhraseMgr::PostGemMsg() passes a GemPacket's loc, gem, and trans values to AddGem() in member order, and the member names follow the labels Gem::Print() writes for them. The type name is inferred. The record has no descriptor, allocation tag, or literal.

On the wire the position travels as two bytes, mGem as one unsigned byte, and mTrans as one signed byte.

The fill value Load() hands to resize() sets the position alone, which is Sch::Tick's default constructor at work. The inline comparison is recovered from its expansion in the gem search AddGem() performs.

Member Function Documentation

◆ operator<()

bool Phrase::Gem::operator< ( const Gem & other) const
inline

Order two gems by position.

Parameters
otherThe gem to compare against.
Returns
Whether this gem comes first.

◆ operator==()

bool Phrase::Gem::operator== ( const Gem & other) const
inline

Compare two gems member by member, in declaration order.

Recovered from its expansion in PhraseMgr::PhrasesMatch().

Parameters
otherThe gem to compare against.
Returns
Whether all three members are equal.

Member Data Documentation

◆ mPosition

Sch::Tick Phrase::Gem::mPosition

Song position of the gem. +0x00

◆ mGem

int Phrase::Gem::mGem

Which gem. +0x04

◆ mTrans

int Phrase::Gem::mTrans

Transposition of the gem. +0x08


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