RhythmGame 1.4.3
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Attributes | Properties | List of all members
gameplay_logic::Player Class Reference

A player of a chart. More...

#include <ChartRunner.h>

Inheritance diagram for gameplay_logic::Player:
Inheritance graph
[legend]
Collaboration diagram for gameplay_logic::Player:
Collaboration graph
[legend]

Signals

void positionChanged (double delta)
 
void beatPositionChanged (double delta)
 
void elapsedChanged (int64_t delta)
 
void bpmChanged ()
 
void scrollChanged ()
 
void speedMultiplierChanged ()
 
void statusChanged ()
 

Public Member Functions

 Player (BmsNotes *notes, BmsLiveScore *score, GameplayState *state, resource_managers::Profile *profile, QFuture< BmsGameReferee > referee, std::chrono::nanoseconds chartLength, double initialBpm, QObject *parent=nullptr)
 
virtual void update (std::chrono::nanoseconds offsetFromStart, bool lastUpdate)
 
virtual void passKey (input::BmsKey key, ChartRunner::EventType eventType, std::chrono::nanoseconds offset)
 
void setup ()
 
auto getNotes () const -> BmsNotes *
 
auto getScore () const -> BmsLiveScore *
 
auto getState () const -> GameplayState *
 
auto getColumns () const -> QList< int >
 
Q_INVOKABLE bool isScratchColumn (int column) const
 
auto getProfile () const -> resource_managers::Profile *
 
auto getPosition () const -> double
 
auto getBeatPosition () const -> double
 
auto positionAt (std::chrono::nanoseconds offsetFromStart) const -> double
 
auto speedMultiplierAt (std::chrono::nanoseconds offsetFromStart) const -> double
 
auto hasSpeedChanges () const -> bool
 
auto getSpeedMultiplier () const -> double
 
auto beatPositionAt (std::chrono::nanoseconds offsetFromStart) const -> double
 
auto getElapsed () const -> int64_t
 
auto getStatus () const -> ChartRunner::Status
 
void setStatus (ChartRunner::Status status)
 
auto getChartLength () const -> int64_t
 
auto getBpm () const -> double
 
auto getScroll () const -> double
 
auto finish (const ChartData &chartData) -> BmsScore *
 

Protected Attributes

std::optional< BmsGameReferee > referee
 

Properties

BmsNotes * notes
 The notes of the chart being played.
 
BmsLiveScore * score
 The live score of the player, which gets updated during gameplay.
 
GameplayState * state
 The gameplay state of the player, containing column states and barlines.
 
QList< int > columns
 Playable column indices in the default visual order.
 
resource_managers::Profile * profile
 The profile of the player.
 
double position
 The positition in the chart, expressed in beats*scroll.
 
double beatPosition
 The position in the chart, expressed in beats.
 
double bpm
 The current BPM of the chart.
 
double scroll = 1.0
 The current #SCROLL of the chart.
 
double speedMultiplier = 1.0
 Current #SPEED multiplier at the visual chart time, or 1.
 
int64_t elapsed {}
 The elapsed time since the start of the chart, in nanoseconds.
 
ChartRunner::Status status { ChartRunner::Status::Loading }
 The current status of the player.
 
int64_t chartLength
 The length of the chart in nanoseconds.
 

Detailed Description

A player of a chart.

The Player class represents a player of a chart. It plays sounds, gets its score updated, etc.

Constructor & Destructor Documentation

◆ Player()

gameplay_logic::Player::Player ( BmsNotes *  notes,
BmsLiveScore *  score,
GameplayState *  state,
resource_managers::Profile *  profile,
QFuture< BmsGameReferee >  referee,
std::chrono::nanoseconds  chartLength,
double  initialBpm,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ beatPositionAt()

auto gameplay_logic::Player::beatPositionAt ( std::chrono::nanoseconds  offsetFromStart) const -> double

◆ beatPositionChanged

void gameplay_logic::Player::beatPositionChanged ( double  delta)
signal

◆ bpmChanged

void gameplay_logic::Player::bpmChanged ( )
signal

◆ elapsedChanged

void gameplay_logic::Player::elapsedChanged ( int64_t  delta)
signal

◆ finish()

auto gameplay_logic::Player::finish ( const ChartData &  chartData) -> BmsScore*

◆ getBeatPosition()

auto gameplay_logic::Player::getBeatPosition ( ) const -> double

◆ getBpm()

double gameplay_logic::Player::getBpm ( ) const -> double

◆ getChartLength()

auto gameplay_logic::Player::getChartLength ( ) const -> int64_t

◆ getColumns()

auto gameplay_logic::Player::getColumns ( ) const -> QList<int>

◆ getElapsed()

auto gameplay_logic::Player::getElapsed ( ) const -> int64_t

◆ getNotes()

auto gameplay_logic::Player::getNotes ( ) const -> BmsNotes*

◆ getPosition()

auto gameplay_logic::Player::getPosition ( ) const -> double

◆ getProfile()

auto gameplay_logic::Player::getProfile ( ) const -> resource_managers::Profile*

◆ getScore()

auto gameplay_logic::Player::getScore ( ) const -> BmsLiveScore*

◆ getScroll()

double gameplay_logic::Player::getScroll ( ) const -> double

◆ getSpeedMultiplier()

auto gameplay_logic::Player::getSpeedMultiplier ( ) const -> double
inline

◆ getState()

auto gameplay_logic::Player::getState ( ) const -> GameplayState*

◆ getStatus()

auto gameplay_logic::Player::getStatus ( ) const -> ChartRunner::Status

◆ hasSpeedChanges()

auto gameplay_logic::Player::hasSpeedChanges ( ) const -> bool

◆ isScratchColumn()

bool gameplay_logic::Player::isScratchColumn ( int  column) const

Whether a column index identifies a scratch lane.

◆ passKey()

void gameplay_logic::Player::passKey ( input::BmsKey  key,
ChartRunner::EventType  eventType,
std::chrono::nanoseconds  offset 
)
virtual

◆ positionAt()

auto gameplay_logic::Player::positionAt ( std::chrono::nanoseconds  offsetFromStart) const -> double

◆ positionChanged

void gameplay_logic::Player::positionChanged ( double  delta)
signal

◆ scrollChanged

void gameplay_logic::Player::scrollChanged ( )
signal

◆ setStatus()

void gameplay_logic::Player::setStatus ( ChartRunner::Status  status)

◆ setup()

void gameplay_logic::Player::setup ( )

◆ speedMultiplierAt()

auto gameplay_logic::Player::speedMultiplierAt ( std::chrono::nanoseconds  offsetFromStart) const -> double

◆ speedMultiplierChanged

void gameplay_logic::Player::speedMultiplierChanged ( )
signal

◆ statusChanged

void gameplay_logic::Player::statusChanged ( )
signal

◆ update()

void gameplay_logic::Player::update ( std::chrono::nanoseconds  offsetFromStart,
bool  lastUpdate 
)
virtual

Member Data Documentation

◆ referee

std::optional<BmsGameReferee> gameplay_logic::Player::referee
protected

Property Documentation

◆ beatPosition

double gameplay_logic::Player::beatPosition
read

The position in the chart, expressed in beats.

◆ bpm

double gameplay_logic::Player::bpm
read

The current BPM of the chart.

◆ chartLength

int64_t gameplay_logic::Player::chartLength
read

The length of the chart in nanoseconds.

◆ columns

QList<int> gameplay_logic::Player::columns
read

Playable column indices in the default visual order.

Uses the player's effective keymode, with the left scratch first and the right scratch last. Five-key modes omit unused columns. Themes can reorder these indices without changing the underlying column states.

◆ elapsed

int64_t gameplay_logic::Player::elapsed {}
read

The elapsed time since the start of the chart, in nanoseconds.

◆ notes

BmsNotes * gameplay_logic::Player::notes
read

The notes of the chart being played.

◆ position

double gameplay_logic::Player::position
read

The positition in the chart, expressed in beats*scroll.

◆ profile

resource_managers::Profile* gameplay_logic::Player::profile
read

The profile of the player.

◆ score

BmsLiveScore * gameplay_logic::Player::score
read

The live score of the player, which gets updated during gameplay.

◆ scroll

double gameplay_logic::Player::scroll = 1.0
read

The current #SCROLL of the chart.

◆ speedMultiplier

double gameplay_logic::Player::speedMultiplier = 1.0
read

Current #SPEED multiplier at the visual chart time, or 1.

Multiply drawing distances from the judgement line by this value. Note positions, BPM, #SCROLL and hit timestamps are unchanged.

◆ state

GameplayState * gameplay_logic::Player::state
read

The gameplay state of the player, containing column states and barlines.

◆ status

ChartRunner::Status gameplay_logic::Player::status { ChartRunner::Status::Loading }
read

The current status of the player.


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