RhythmGame 1.4.3
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
gameplay_logic::BmsGameReferee Class Reference

The update manager of notes and sounds during gameplay. More...

#include <BmsGameReferee.h>

Classes

struct  PositionInfo
 The position at which we are in the chart. More...
 

Public Types

using Position = double
 

Public Member Functions

 BmsGameReferee (const BmsGameReferee &)=delete
 
BmsGameReferee & operator= (const BmsGameReferee &)=delete
 
 BmsGameReferee (BmsGameReferee &&)=default
 
BmsGameReferee & operator= (BmsGameReferee &&)=default
 
 BmsGameReferee (std::array< std::vector< charts::BmsNotesData::Note >, charts::BmsNotesData::columnNumber > notes, const std::vector< std::pair< charts::BmsNotesData::Time, uint64_t > > &bgmNotes, std::vector< charts::BmsNotesData::BpmChangeValues > bpmChanges, std::vector< charts::BmsNotesData::SpeedChange > speedChanges, std::shared_ptr< sounds::Sound > mineHitSound, BmsLiveScore *score, std::unordered_map< uint64_t, std::shared_ptr< sounds::Sound > > sounds, rules::HitRules hitRules)
 
void update (std::chrono::nanoseconds offsetFromStart, bool lastUpdate=false)
 Update the internal state of the referee.
 
auto getBpm (std::chrono::nanoseconds offsetFromStart) const -> charts::BmsNotesData::BpmChangeValues
 
auto getSpeedMultiplier (std::chrono::nanoseconds offsetFromStart) const -> double
 
auto hasSpeedChanges () const -> bool
 
auto passPressed (std::chrono::nanoseconds offsetFromStart, input::BmsKey key) -> void
 Handle a key press event.
 
auto passReleased (std::chrono::nanoseconds offsetFromStart, input::BmsKey key) -> void
 Handle a key press event.
 

Static Public Member Functions

static auto getPosition (charts::BmsNotesData::BpmChangeValues bpm, std::chrono::nanoseconds offsetFromStart) -> PositionInfo
 Get the position in the chart, expressed in beats.
 

Detailed Description

The update manager of notes and sounds during gameplay.

The BmsGameReferee class is responsible for getting hits and misses of notes, playing note and BGM sounds, and providing the current position of notes.

Member Typedef Documentation

◆ Position

Constructor & Destructor Documentation

◆ BmsGameReferee() [1/3]

gameplay_logic::BmsGameReferee::BmsGameReferee ( const BmsGameReferee &  )
delete

◆ BmsGameReferee() [2/3]

gameplay_logic::BmsGameReferee::BmsGameReferee ( BmsGameReferee &&  )
default

◆ BmsGameReferee() [3/3]

gameplay_logic::BmsGameReferee::BmsGameReferee ( std::array< std::vector< charts::BmsNotesData::Note >, charts::BmsNotesData::columnNumber >  notes,
const std::vector< std::pair< charts::BmsNotesData::Time, uint64_t > > &  bgmNotes,
std::vector< charts::BmsNotesData::BpmChangeValues >  bpmChanges,
std::vector< charts::BmsNotesData::SpeedChange >  speedChanges,
std::shared_ptr< sounds::Sound >  mineHitSound,
BmsLiveScore *  score,
std::unordered_map< uint64_t, std::shared_ptr< sounds::Sound > >  sounds,
rules::HitRules  hitRules 
)
explicit

Member Function Documentation

◆ getBpm()

auto gameplay_logic::BmsGameReferee::getBpm ( std::chrono::nanoseconds  offsetFromStart) const -> charts::BmsNotesData::BpmChangeValues

◆ getPosition()

auto gameplay_logic::BmsGameReferee::getPosition ( charts::BmsNotesData::BpmChangeValues  bpm,
std::chrono::nanoseconds  offsetFromStart 
) -> PositionInfo
static

Get the position in the chart, expressed in beats.

Parameters
bpmThe current BPM change (as returned by getBpm())
offsetFromStartThe time offset from the start of the chart
Returns
The position in the chart

◆ getSpeedMultiplier()

auto gameplay_logic::BmsGameReferee::getSpeedMultiplier ( std::chrono::nanoseconds  offsetFromStart) const -> double

◆ hasSpeedChanges()

auto gameplay_logic::BmsGameReferee::hasSpeedChanges ( ) const -> bool
inline

◆ operator=() [1/2]

BmsGameReferee & gameplay_logic::BmsGameReferee::operator= ( BmsGameReferee &&  )
default

◆ operator=() [2/2]

BmsGameReferee & gameplay_logic::BmsGameReferee::operator= ( const BmsGameReferee &  )
delete

◆ passPressed()

auto gameplay_logic::BmsGameReferee::passPressed ( std::chrono::nanoseconds  offsetFromStart,
input::BmsKey  key 
) -> void

Handle a key press event.

Parameters
offsetFromStartThe time offset from the start of the chart when the press happened
keyThe key that was pressed
See also
update()

◆ passReleased()

auto gameplay_logic::BmsGameReferee::passReleased ( std::chrono::nanoseconds  offsetFromStart,
input::BmsKey  key 
) -> void

Handle a key press event.

Parameters
offsetFromStartThe time offset from the start of the chart when the release happened
keyThe key that was released
See also
update()

◆ update()

void gameplay_logic::BmsGameReferee::update ( std::chrono::nanoseconds  offsetFromStart,
bool  lastUpdate = false 
)

Update the internal state of the referee.

Parameters
offsetFromStartThe current time offset from the start of the chart
lastUpdateIf true, don't play any sounds in this and future updates
Warning
If this function detects a miss and you then use passPressed() or passReleased() with an older timestamp, the miss will not be rectified.

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