RhythmGame 1.4.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Properties | Friends | List of all members
gameplay_logic::HitEvent Class Reference

A very generic event that happened during gameplay. More...

#include <HitEvent.h>

Public Types

enum class  Action { None , Press , Release }
 

Public Member Functions

 HitEvent (int column, std::optional< input::BmsKey > key, std::optional< int > noteIndex, DeltaTime offsetFromStart, std::optional< BmsPoints > points, Action action, bool noteRemoved)
 
 HitEvent (int column, std::optional< int > noteIndex, DeltaTime offsetFromStart, std::optional< BmsPoints > points, Action action, bool noteRemoved)
 
 HitEvent ()=default
 
auto getOffsetFromStart () const -> DeltaTime
 
auto getHitOffset () const -> DeltaTime
 
auto getJudgement () const -> int
 
auto getDeviation () const -> DeltaTime
 
auto getPoints () const -> QVariant
 
auto getPointsOptional () const -> std::optional< BmsPoints >
 
auto getColumn () const -> int
 
auto getKey () const -> int
 
auto getKeyOptional () const -> std::optional< input::BmsKey >
 
auto getNoteIndex () const -> int
 
auto getAction () const -> Action
 
auto getNoteRemoved () const -> bool
 
void setAction (Action newAction)
 
void setPoints (std::optional< BmsPoints > newPoints)
 
void setNoteRemoved (bool newNoteRemoved)
 
auto operator> (const HitEvent &other) const
 
auto operator== (const HitEvent &other) const -> bool
 

Properties

DeltaTime offsetFromStart
 The offset from the start of the chart when this event happened.
 
DeltaTime hitOffset
 The offset from the note's perfect hit time when this event happened.
 
int judgement
 Judgement awarded for this event, or -1 when none was awarded.
 
DeltaTime deviation
 Signed timing deviation in nanoseconds, or 0 when unavailable.
 
QVariant points
 The points awarded for this hit.
 
int column
 The column where this event happened.
 
int key
 The physical key that caused this event or -1 if not applicable.
 
int noteIndex
 The index of the note that was hit or -1 if no note was hit.
 
Action action
 What the user did to cause this event to happen.
 
bool noteRemoved
 Whether this event removed a note.
 

Friends

auto operator<< (QDataStream &stream, const HitEvent &tap) -> QDataStream &
 
auto operator>> (QDataStream &stream, HitEvent &tap) -> QDataStream &
 

Detailed Description

A very generic event that happened during gameplay.

It represents hits but also misses and note releases. Hits that hit nothing as well.

Member Enumeration Documentation

◆ Action

Enumerator
None 
Press 

The player did not press or release a key in this event.

Release 

The player pressed a key. The player released a key.

Constructor & Destructor Documentation

◆ HitEvent() [1/3]

gameplay_logic::HitEvent::HitEvent ( int  column,
std::optional< input::BmsKey >  key,
std::optional< int >  noteIndex,
DeltaTime  offsetFromStart,
std::optional< BmsPoints >  points,
Action  action,
bool  noteRemoved 
)

◆ HitEvent() [2/3]

gameplay_logic::HitEvent::HitEvent ( int  column,
std::optional< int >  noteIndex,
DeltaTime  offsetFromStart,
std::optional< BmsPoints >  points,
Action  action,
bool  noteRemoved 
)
inline

◆ HitEvent() [3/3]

gameplay_logic::HitEvent::HitEvent ( )
default

Member Function Documentation

◆ getAction()

auto gameplay_logic::HitEvent::getAction ( ) const -> Action

◆ getColumn()

auto gameplay_logic::HitEvent::getColumn ( ) const -> int

◆ getDeviation()

auto gameplay_logic::HitEvent::getDeviation ( ) const -> DeltaTime

◆ getHitOffset()

auto gameplay_logic::HitEvent::getHitOffset ( ) const -> DeltaTime

◆ getJudgement()

auto gameplay_logic::HitEvent::getJudgement ( ) const -> int

◆ getKey()

auto gameplay_logic::HitEvent::getKey ( ) const -> int

◆ getKeyOptional()

auto gameplay_logic::HitEvent::getKeyOptional ( ) const -> std::optional<input::BmsKey>

◆ getNoteIndex()

auto gameplay_logic::HitEvent::getNoteIndex ( ) const -> int

◆ getNoteRemoved()

auto gameplay_logic::HitEvent::getNoteRemoved ( ) const -> bool

◆ getOffsetFromStart()

auto gameplay_logic::HitEvent::getOffsetFromStart ( ) const -> DeltaTime

◆ getPoints()

auto gameplay_logic::HitEvent::getPoints ( ) const -> QVariant

◆ getPointsOptional()

auto gameplay_logic::HitEvent::getPointsOptional ( ) const -> std::optional<BmsPoints>

◆ operator==()

auto gameplay_logic::HitEvent::operator== ( const HitEvent &  other) const -> bool
inline

◆ operator>()

auto gameplay_logic::HitEvent::operator> ( const HitEvent &  other) const
inline

◆ setAction()

void gameplay_logic::HitEvent::setAction ( Action  newAction)

◆ setNoteRemoved()

void gameplay_logic::HitEvent::setNoteRemoved ( bool  newNoteRemoved)

◆ setPoints()

void gameplay_logic::HitEvent::setPoints ( std::optional< BmsPoints >  newPoints)

Friends And Related Symbol Documentation

◆ operator<<

auto operator<< ( QDataStream &  stream,
const HitEvent &  tap 
) -> QDataStream&
friend

◆ operator>>

auto operator>> ( QDataStream &  stream,
HitEvent &  tap 
) -> QDataStream&
friend

Property Documentation

◆ action

Action gameplay_logic::HitEvent::action
read

What the user did to cause this event to happen.

◆ column

int gameplay_logic::HitEvent::column
read

The column where this event happened.

◆ deviation

DeltaTime gameplay_logic::HitEvent::deviation
read

Signed timing deviation in nanoseconds, or 0 when unavailable.

◆ hitOffset

DeltaTime gameplay_logic::HitEvent::hitOffset
read

The offset from the note's perfect hit time when this event happened.

Will be 0 for hits that hit nothing.

Note
This simply forwards the value from BmsPoints::deviation.

◆ judgement

int gameplay_logic::HitEvent::judgement
read

Judgement awarded for this event, or -1 when none was awarded.

◆ key

int gameplay_logic::HitEvent::key
read

The physical key that caused this event or -1 if not applicable.

This differs from column for scratch where up/down share one logical lane.

◆ noteIndex

int gameplay_logic::HitEvent::noteIndex
read

The index of the note that was hit or -1 if no note was hit.

This index corresponds to the index in BmsNotes::notes. It will be -1 for hits that hit nothing.

◆ noteRemoved

bool gameplay_logic::HitEvent::noteRemoved
read

Whether this event removed a note.

False for empty poors. The note can still be hit again.

◆ offsetFromStart

DeltaTime gameplay_logic::HitEvent::offsetFromStart
read

The offset from the start of the chart when this event happened.

◆ points

QVariant gameplay_logic::HitEvent::points
read

The points awarded for this hit.

Will be null for hits that hit nothing.

See also
BmsPoints

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