JubeatPlus 3.9.11
Loading...
Searching...
No Matches
Sequence Class Reference

The core gameplay judgement engine for a single play session. More...

#include <Sequence.h>

Inheritance diagram for Sequence:
Collaboration diagram for Sequence:

Instance Methods

(instancetype) - initWithData:
 Initialises the engine from a packed binary sequence blob.
(instancetype) - initWithCustomData:tableData:
 Initialises the engine from an editor's custom chart dictionary and note table.
(void) - replay
 Resets the play state for a replay, preserving the recorded replay-judge tables.
(void) - reset
 Resets the play state and clears every recorded judgement for a fresh play.
(void) - seekToTime:
 Advances the play position to a time, updating the tempo, measure, and beat phases.
(void) - getMarkerState:
 Fills a per-panel marker-animation state array for the current position.
(void) - getHoldMarkerState:
 Fills a per-panel hold-marker state array for the current position.
(const ScoreData *) - getScore
 Returns the live score summary.
(BOOL) - isFullcombo
 Returns whether every scoring note has been judged at least good (a full combo).
(BOOL) - isExcellent
 Returns whether every scoring note was judged perfect (an excellent).
(SequenceRank) - rank
 Returns the score rank tier for the current total points.
(const char *) - getMusicBar
 Returns the chart's raw music-bar bitmap.
(nullable NSArray *) - getPlayEvents
 Returns the tap events as boxed [grade, panel] number pairs.
(nullable NSArray *) - getHoldEvents
 Returns the hold events as boxed [grade, value] number pairs.
(void) - judge:btnPress:
 Judges the current button state against the notes around the play position.

Class Methods

(void) + getMusicBarData:raw:
 Copies the chart's raw music-bar bitmap out of an encoded sequence blob.
(unsigned int) + checkExistHoldMarkerFlag:
 Returns a bitmask of which difficulties in a downloaded pack contain a hold marker.
(BOOL) + checkExistHoldMarker:
 Returns whether a single decoded sequence blob contains any hold marker.
(SequenceRank) + rankOfPoint:
 Maps a point total to its score rank tier.

Protected Attributes

SequenceEvent * events
 The malloc'd chart-event array.
unsigned int numEvent
 The number of events in events .
unsigned int numPlayEvent
 The number of judged (scoring) notes.
unsigned int endSector
 The chart's final sector.
char musicBar [kSequenceMusicBarByteCount]
 The raw music-bar bitmap from the chart.
unsigned int currentIndex
 The seek cursor over events .
unsigned int currentHoldIndex
 The seek cursor over hold events.
unsigned int judgedIndex
 The judgement cursor over events .
unsigned int currentTempo
 The tempo in effect at the play position.
unsigned int oldTempo
 The tempo in effect before the last change.
unsigned int lastHakuSector
 The sector of the last beat (haku) line.
unsigned int nextHakuSector
 The sector of the next beat (haku) line.
unsigned int lastMeasureSector
 The sector of the last measure line.
unsigned int nextMeasureSector
 The sector of the next measure line.
short lastJudge [kSequencePanelCount]
 The most recent grade shown per panel.
unsigned int lastJudgeSector [kSequencePanelCount]
 The sector of that grade per panel.
ScoreData gameScore
 The live score summary.
unsigned int replaceTable [kSequencePanelCount]
 The panel-remap table (random mode).
BOOL isPerfectMode
 Whether perfect-mode judging is in effect.
NSArray * playEventTable
 Tap events, as boxed [grade, panel] pairs.
NSArray * holdEventTable
 Hold events, as boxed [grade, value] pairs.
short * replayJudgeTable
 The recorded per-note tap grades, for replay.
short * replayTmpJudgeTable
 The recorded per-note hold grades, for replay.
unsigned short _firstMarker
 The panel bitmask of the first marker.
unsigned int _currentSector
 The current play position, in sectors.
unsigned int _firstMarkerSector
 The sector of the first marker.
double _currentTime
 The current play position, in seconds.

Properties

float hakuPhase
 The normalised phase within the current beat (haku) interval, in [0, 1].
float measurePhase
 The normalised phase within the current measure interval, in [0, 1].
float playPosition
 The normalised play position over the whole chart, in [0, 1].
double currentTime
 The current play position, in seconds.
unsigned int currentSector
 The current play position, in sectors.
unsigned short firstMarker
 The panel bitmask of the first marker.
unsigned int firstMarkerSector
 The sector of the first marker.

Detailed Description

The core gameplay judgement engine for a single play session.

Method Documentation

◆ checkExistHoldMarker:

+ (BOOL) checkExistHoldMarker: (nullable NSData *) data

Returns whether a single decoded sequence blob contains any hold marker.

Parameters
dataThe decoded sequence blob.
Returns
YES if any event is a hold event.
Ghidra address:
0x1ab92c

◆ checkExistHoldMarkerFlag:

+ (unsigned int) checkExistHoldMarkerFlag: (nullable KUnzip *) data

Returns a bitmask of which difficulties in a downloaded pack contain a hold marker.

Parameters
dataThe KUnzip archive holding the three difficulty sequence entries.
Returns
Bit 0 basic, bit 1 advanced, and bit 2 extreme, set where that difficulty has a hold.
Ghidra address:
0x1ab608

◆ getHoldEvents

- (NSArray *) getHoldEvents

Returns the hold events as boxed [grade, value] number pairs.

Returns
The hold events, each a boxed grade and value pair.
Ghidra address:
0x1adbc8

◆ getHoldMarkerState:

- (void) getHoldMarkerState: (MainGameHoldState *) state

Fills a per-panel hold-marker state array for the current position.

Parameters
stateA 16-element destination array of MainGameHoldState .
Ghidra address:
0x1ace9c

◆ getMarkerState:

- (void) getMarkerState: (int *) state

Fills a per-panel marker-animation state array for the current position.

Parameters
stateA 16-element destination array of packed marker states.
Ghidra address:
0x1accc4

◆ getMusicBar

- (const char *) getMusicBar

Returns the chart's raw music-bar bitmap.

Returns
A pointer to the internal 60-byte bitmap; not owned by the caller.
Ghidra address:
0x1ad058

◆ getMusicBarData:raw:

+ (void) getMusicBarData: (char *) raw
raw: (nullable NSData *) data 

Copies the chart's raw music-bar bitmap out of an encoded sequence blob.

Parameters
rawThe 60-byte destination buffer.
dataThe encoded sequence blob; ignored unless longer than 96 bytes.
Ghidra address:
0x1ab5a4

◆ getPlayEvents

- (NSArray *) getPlayEvents

Returns the tap events as boxed [grade, panel] number pairs.

Returns
The tap events, each a boxed grade and panel pair.
Ghidra address:
0x1adbb8

◆ getScore

- (const ScoreData *) getScore

Returns the live score summary.

Returns
A pointer to the internal score data; not owned by the caller.
Ghidra address:
0x1acfd0

◆ initWithCustomData:tableData:

- (instancetype) initWithCustomData: (nullable NSDictionary *) data
tableData: (nullable NSArray *) tableData 

Initialises the engine from an editor's custom chart dictionary and note table.

Parameters
dataThe chart-header dictionary (event count, note count, end sector, first marker).
tableDataThe array of boxed packed note words.
Returns
The initialised engine, or nil.
Ghidra address:
0x1ac3a0

◆ initWithData:

- (instancetype) initWithData: (nullable NSData *) data

Initialises the engine from a packed binary sequence blob.

Parameters
dataThe encoded sequence blob, whose header is one of the "IJBQ" / "IJSQ" magics.
Returns
The initialised engine, or nil if the blob is missing or malformed.
Ghidra address:
0x1abe24

◆ isExcellent

- (BOOL) isExcellent

Returns whether every scoring note was judged perfect (an excellent).

Returns
YES on an excellent, NO otherwise.
Ghidra address:
0x1ad008

◆ isFullcombo

- (BOOL) isFullcombo

Returns whether every scoring note has been judged at least good (a full combo).

Returns
YES on a full combo, NO otherwise.
Ghidra address:
0x1acfe0

◆ judge:btnPress:

- (void) judge: (int) btnPress
btnPress: (int) btnDown 

Judges the current button state against the notes around the play position.

Parameters
btnPressThe bitmask of buttons newly pressed this frame.
btnDownThe bitmask of buttons currently held down.
Ghidra address:
0x1ad360

◆ rank

- (SequenceRank) rank

Returns the score rank tier for the current total points.

Returns
The rank tier the current total points fall in.
Ghidra address:
0x1ad030

◆ rankOfPoint:

+ (SequenceRank) rankOfPoint: (unsigned int) point

Maps a point total to its score rank tier.

Parameters
pointThe total points.
Returns
The rank tier.
Ghidra address:
0x1aba80

◆ replay

- (void) replay

Resets the play state for a replay, preserving the recorded replay-judge tables.

Ghidra address:
0x1ac728

◆ reset

- (void) reset

Resets the play state and clears every recorded judgement for a fresh play.

Ghidra address:
0x1ac8fc

◆ seekToTime:

- (void) seekToTime: (double) time

Advances the play position to a time, updating the tempo, measure, and beat phases.

Parameters
timeThe new play time, in seconds; times before the current one are ignored.
Ghidra address:
0x1acaac

Property Documentation

◆ currentSector

- (unsigned int) currentSector
readnonatomicassign

The current play position, in sectors.

Ghidra address:
0x1adbe8

◆ currentTime

- (double) currentTime
readnonatomicassign

The current play position, in seconds.

Ghidra address:
0x1adbd8

◆ firstMarker

- (unsigned short) firstMarker
readnonatomicassign

The panel bitmask of the first marker.

Ghidra address:
0x1adbf8

◆ firstMarkerSector

- (unsigned int) firstMarkerSector
readnonatomicassign

The sector of the first marker.

Ghidra address:
0x1adc08

◆ hakuPhase

- (float) hakuPhase
readnonatomicassign

The normalised phase within the current beat (haku) interval, in [0, 1].

Ghidra address:
0x1ad068

◆ measurePhase

- (float) measurePhase
readnonatomicassign

The normalised phase within the current measure interval, in [0, 1].

Ghidra address:
0x1ad0b4

◆ playPosition

- (float) playPosition
readnonatomicassign

The normalised play position over the whole chart, in [0, 1].

Ghidra address:
0x1ad100

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