wavelength 1.0.0
Loading...
Searching...
No Matches
RateAverager Class Reference

Average of the rate of the gems of one bar. More...

#include <rateaverager.h>

Public Member Functions

 RateAverager (int nTicksPerBar)
 Construct an average with no samples.
void Reset ()
 Forget every sample.
void Sample (int nSlot, int nTick)
 Add a gem.
float GetMean () const
 Report the average rate.
float GetSum () const

Detailed Description

Average of the rate of the gems of one bar.

The class is not polymorphic and has no RTTI. The name is inferred. Each sample after the first adds the length of a bar divided by the ticks since the previous sample.

Constructor & Destructor Documentation

◆ RateAverager()

RateAverager::RateAverager ( int nTicksPerBar)
explicit

Construct an average with no samples.

Parameters
nTicksPerBarThe length of a bar in ticks.
Ghidra address:
NTSC-U/C: 0x0014a8b0
Ghidra address:
PAL: 0x0014c270

Member Function Documentation

◆ Reset()

void RateAverager::Reset ( )

Forget every sample.

Ghidra address:
NTSC-U/C: 0x0014a8e0
Ghidra address:
PAL: 0x0014c2a0

◆ Sample()

void RateAverager::Sample ( int nSlot,
int nTick )

Add a gem.

Parameters
nSlotThe slot of the gem. The body does not read it.
nTickThe tick of the gem.
Ghidra address:
NTSC-U/C: 0x0014a8f8
Ghidra address:
PAL: 0x0014c2b8

◆ GetMean()

float RateAverager::GetMean ( ) const

Report the average rate.

Returns
The sum of the rates over the number of samples.
Ghidra address:
NTSC-U/C: 0x0014a948
Ghidra address:
PAL: 0x0014c308

◆ GetSum()

float RateAverager::GetSum ( ) const
inline
Returns
The sum of the rates.

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