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

Command that runs the commands of a track named "SCRIPT" of the MIDI file, each at its tick. More...

#include <playscriptcmd.h>

Inheritance diagram for PlayScriptCmd:
Collaboration diagram for PlayScriptCmd:

Public Member Functions

 PlayScriptCmd (ScriptTrackData *pTrack, float *pTickDuration)
 Construct a command at the first command of a track.
 ~PlayScriptCmd () override
 Release the command.
void Execute () override
 Run the next command of the track and post the one after it.
void ScheduleNext ()
 Post the command at the tick of the next command of the track, or report the end of the track to the waiting task.
int GetStartTick () const
void SetStartTick (int nStartTick)
int GetNextCommand () const
void SetNextCommand (int nNextCommand)
ScriptTrackData * GetTrack () const
void SetWaitingTask (Task *pWaitingTask)
Public Member Functions inherited from Command
 ~Command () override
 Release the command.
virtual bool IsSerializable ()
 Report whether a recording saves the command.
virtual int GetSerialId ()
 Report the identifier a recording rebuilds the command by.
virtual void Save (BinStream &stream) const
 Write the command to a recording.
virtual void Load (BinStream &stream)
 Read the command Save() writes.
Public Member Functions inherited from Attachment
 Attachment ()
 Construct an object with no reference.
virtual ~Attachment ()
 Release the object.
void AddRef ()
 Take one reference.
void Release ()
 Give back one reference and delete the object once the last one is gone.

Additional Inherited Members

Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.

Detailed Description

Command that runs the commands of a track named "SCRIPT" of the MIDI file, each at its tick.

The RTTI includes the class name and records Command as the base. The command posts itself on the song scheduler at the tick of each command in turn. Once the last command ran, the task waiting on the track is told the track is done. TutorialGameLogic builds the command inline, and the members are defined in the class.

Constructor & Destructor Documentation

◆ PlayScriptCmd()

PlayScriptCmd::PlayScriptCmd ( ScriptTrackData * pTrack,
float * pTickDuration )
inline

Construct a command at the first command of a track.

Parameters
pTrackThe commands.
pTickDurationThe duration of one song tick. The command does not read it.

◆ ~PlayScriptCmd()

PlayScriptCmd::~PlayScriptCmd ( )
inlineoverride

Release the command.

Ghidra address:
NTSC-U/C: 0x00343ce8
Ghidra address:
PAL: 0x003b1220

Member Function Documentation

◆ Execute()

void PlayScriptCmd::Execute ( )
inlineoverridevirtual

Run the next command of the track and post the one after it.

Ghidra address:
NTSC-U/C: 0x00343d60
Ghidra address:
PAL: 0x003b1298

Implements Command.

◆ ScheduleNext()

void PlayScriptCmd::ScheduleNext ( )
inline

Post the command at the tick of the next command of the track, or report the end of the track to the waiting task.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00343da8
Ghidra address:
PAL: 0x003b12e0

◆ GetStartTick()

int PlayScriptCmd::GetStartTick ( ) const
inline
Returns
The song tick the ticks of the commands count from.

◆ SetStartTick()

void PlayScriptCmd::SetStartTick ( int nStartTick)
inline
Parameters
nStartTickThe song tick the ticks of the commands count from.

◆ GetNextCommand()

int PlayScriptCmd::GetNextCommand ( ) const
inline
Returns
The index of the command that runs next.

◆ SetNextCommand()

void PlayScriptCmd::SetNextCommand ( int nNextCommand)
inline
Parameters
nNextCommandThe index of the command that runs next.

◆ GetTrack()

ScriptTrackData * PlayScriptCmd::GetTrack ( ) const
inline
Returns
The commands.

◆ SetWaitingTask()

void PlayScriptCmd::SetWaitingTask ( Task * pWaitingTask)
inline
Parameters
pWaitingTaskThe task waiting for the end of the track, or null.

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