wavelength 1.0.0
Loading...
Searching...
No Matches
FreestyleTrack Class Referenceabstract

Track the player plays freely with the analog sticks rather than by hitting gems. More...

#include <freestyletrack.h>

Inheritance diagram for FreestyleTrack:
Collaboration diagram for FreestyleTrack:

Public Member Functions

 FreestyleTrack (const SectionBoundaries *pSections, PlayMap *pPlayMap, const float *pfMsPerTick, int nIndex, int nNumBars, int nTicksPerBar)
 Construct a track.
 ~FreestyleTrack () override
 Release the track.
void Stop () override
 Stop the track with the song.
void SetPlayer (Player *pPlayer) override
 Commit the points of the player that leaves, assign the player, and start the bars of the player that arrives.
void HandleInput (Player *pPlayer, const PlayNoteEvent &event) override
 Send a note the track's player played, and start or stop the scoring of the time it sounds.
void HandleInput (Player *pPlayer, const BtnEvent< 8 > &event) override
 Ignore the event.
void HandleInput (Player *pPlayer, const StickEvent< 2 > &event) override
 Pass a stick position of the track's player to the graphics and the other consoles.
void HandleInput (Player *pPlayer, const StickEvent< 6 > &event) override
 Pass a stick position of the track's player to the graphics.
virtual bool IsActive ()=0
 Report whether the track has an active note.
virtual void Refresh ()=0
 Rebuild what the track plays from the song position.
int WrapTick (int nTick)
 Wrap a tick into the repeat period of the track.
int SpanEnd (int nTick, int nStart, int nEnd)
 Report the tick at which the span that starts at a tick ends.
void UpdatePoints ()
 Award the player pending points for the time the active note sounded in the bar, and run again a twentieth of a bar later.
void StartBar (bool bSchedule)
 Commit the pending points of the bar that ends and restart the timing of the active note.
void SendUpdate (Player *pPlayer, float fX, float fY)
 Send the button and a stick position of a local player to the other consoles, at most once every 150 milliseconds.
int GetTickOffset () const
void SetTickOffset (int nTickOffset)
virtual void HandleInput (Player *pPlayer, const BtnEvent< 10 > &event)=0
 Act on a button event of a player on this track.
Public Member Functions inherited from Track
 Track (int nIndex)
 Construct a track with no player.
virtual ~Track ()
 Release the track.
virtual void Start ()=0
 Start the track with the song.
int GetIndex () const
Player * GetPlayer () const

Protected Attributes

int mTickOffset
Protected Attributes inherited from Track
int mIndex
Player * mPlayer

Detailed Description

Track the player plays freely with the analog sticks rather than by hitting gems.

The RTTI records the class as deriving from Track. AxeTrack and ScratchTrack derive from it. In a game the player earns pending points for the time an active note sounds in each bar, and the points are committed at the end of the bar. Online, the button and the stick positions are sent to the other consoles.

Constructor & Destructor Documentation

◆ FreestyleTrack()

FreestyleTrack::FreestyleTrack ( const SectionBoundaries * pSections,
PlayMap * pPlayMap,
const float * pfMsPerTick,
int nIndex,
int nNumBars,
int nTicksPerBar )

Construct a track.

Parameters
pSectionsThe section boundaries of the song.
pPlayMapThe map of the song positions.
pfMsPerTickThe length of a tick, in milliseconds.
nIndexThe track's index in the song.
nNumBarsThe length of the song, in bars.
nTicksPerBarThe length of a bar, in ticks.
Ghidra address:
NTSC-U/C: 0x0014ef80
Ghidra address:
PAL: 0x001508e0

◆ ~FreestyleTrack()

FreestyleTrack::~FreestyleTrack ( )
override

Release the track.

Ghidra address:
NTSC-U/C: 0x0014f078
Ghidra address:
PAL: 0x001509d8

Member Function Documentation

◆ Stop()

void FreestyleTrack::Stop ( )
overridevirtual

Stop the track with the song.

The member does nothing in this class.

Ghidra address:
NTSC-U/C: 0x0014f0e8
Ghidra address:
PAL: 0x00150a48

Implements Track.

Reimplemented in ScratchTrack.

◆ SetPlayer()

void FreestyleTrack::SetPlayer ( Player * pPlayer)
overridevirtual

Commit the points of the player that leaves, assign the player, and start the bars of the player that arrives.

Parameters
pPlayerThe player, or null.
Ghidra address:
NTSC-U/C: 0x0014f0f0
Ghidra address:
PAL: 0x00150a50

Reimplemented from Track.

Reimplemented in ScratchTrack.

◆ HandleInput() [1/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const PlayNoteEvent & event )
overridevirtual

Send a note the track's player played, and start or stop the scoring of the time it sounds.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0014f258
Ghidra address:
PAL: 0x00150bb8

Implements Track.

Reimplemented in ScratchTrack.

◆ HandleInput() [2/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const BtnEvent< 8 > & event )
inlineoverridevirtual

Ignore the event.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0034b6d8
Ghidra address:
PAL: 0x003b8b08

Implements Track.

Reimplemented in ScratchTrack.

◆ HandleInput() [3/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const StickEvent< 2 > & event )
overridevirtual

Pass a stick position of the track's player to the graphics and the other consoles.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0014f330
Ghidra address:
PAL: 0x00150c90

Implements Track.

Reimplemented in ScratchTrack.

◆ HandleInput() [4/5]

void FreestyleTrack::HandleInput ( Player * pPlayer,
const StickEvent< 6 > & event )
overridevirtual

Pass a stick position of the track's player to the graphics.

Parameters
pPlayerThe player.
eventThe event.
Ghidra address:
NTSC-U/C: 0x0014f3b8
Ghidra address:
PAL: 0x00150d18

Implements Track.

Reimplemented in ScratchTrack.

◆ IsActive()

virtual bool FreestyleTrack::IsActive ( )
pure virtual

Report whether the track has an active note.

Returns
True while a note sounds.

Implemented in AxeTrack, and ScratchTrack.

◆ Refresh()

virtual void FreestyleTrack::Refresh ( )
pure virtual

Rebuild what the track plays from the song position.

Implemented in AxeTrack, and ScratchTrack.

◆ WrapTick()

int FreestyleTrack::WrapTick ( int nTick)

Wrap a tick into the repeat period of the track.

Parameters
nTickThe tick.
Returns
The tick within the period.
Ghidra address:
NTSC-U/C: 0x0014f930
Ghidra address:
PAL: 0x00151290

◆ SpanEnd()

int FreestyleTrack::SpanEnd ( int nTick,
int nStart,
int nEnd )

Report the tick at which the span that starts at a tick ends.

Parameters
nTickThe tick.
nStartThe first tick of the span.
nEndThe tick after the span, or -1 when the span has no end.
Returns
The end tick.
Ghidra address:
NTSC-U/C: 0x0014f980
Ghidra address:
PAL: 0x001512e0

◆ UpdatePoints()

void FreestyleTrack::UpdatePoints ( )

Award the player pending points for the time the active note sounded in the bar, and run again a twentieth of a bar later.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0014f400
Ghidra address:
PAL: 0x00150d60

◆ StartBar()

void FreestyleTrack::StartBar ( bool bSchedule)

Commit the pending points of the bar that ends and restart the timing of the active note.

The name is inferred.

Parameters
bScheduleWhether to run again at the end of the next bar.
Ghidra address:
NTSC-U/C: 0x0014f610
Ghidra address:
PAL: 0x00150f70

◆ SendUpdate()

void FreestyleTrack::SendUpdate ( Player * pPlayer,
float fX,
float fY )

Send the button and a stick position of a local player to the other consoles, at most once every 150 milliseconds.

The name is inferred.

Parameters
pPlayerThe player.
fXThe horizontal stick position.
fYThe vertical stick position.
Ghidra address:
NTSC-U/C: 0x0014f7c8
Ghidra address:
PAL: 0x00151128

◆ GetTickOffset()

int FreestyleTrack::GetTickOffset ( ) const
inline
Returns
The offset of the game tick from the song tick.

◆ SetTickOffset()

void FreestyleTrack::SetTickOffset ( int nTickOffset)
inline
Parameters
nTickOffsetThe offset of the game tick from the song tick.

◆ HandleInput() [5/5]

virtual void Track::HandleInput ( Player * pPlayer,
const BtnEvent< 10 > & event )
virtual

Act on a button event of a player on this track.

Parameters
pPlayerThe player.
eventThe event.

Implements Track.

Reimplemented in ScratchTrack.

Member Data Documentation

◆ mTickOffset

int FreestyleTrack::mTickOffset
protected

The offset of the game tick from the song tick.


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