6#include "GameConstantsAndTypes.h"
7#include "Core/Services/Locator.hpp"
19 TapNoteScore
tns{ TNS_None };
34 [[nodiscard]]
auto CreateNode() const ->
XNode*;
35 void LoadFromNode(const
XNode* pNode);
38 void PushSelf(lua_State* L);
44 [[nodiscard]]
auto GetLastHeldBeat()
const -> float;
46 HoldNoteScore hns{ HNS_None };
64 float fOverlappedTime{ 0 };
68 int iLastHeldRow{ 0 };
72 int iCheckpointsHit{ 0 };
75 int iCheckpointsMissed{ 0 };
81 bool bActive{
false };
84 [[nodiscard]]
auto CreateNode() const ->
XNode*;
85 void LoadFromNode(const
XNode* pNode);
88 void PushSelf(lua_State* L);
103 TapNoteType_AutoKeysound,
111TapNoteTypeToString(TapNoteType tnt) ->
const std::string&;
113TapNoteTypeToLocalizedString(TapNoteType tnt) ->
const std::string&;
114LuaDeclareType(TapNoteType);
124 TapNoteSubType_Invalid
127TapNoteSubTypeToString(TapNoteSubType tnst) ->
const std::string&;
129TapNoteSubTypeToLocalizedString(TapNoteSubType tnst) ->
const std::string&;
130LuaDeclareType(TapNoteSubType);
135 TapNoteSource_Original,
136 TapNoteSource_Addition,
139 TapNoteSource_Invalid
142TapNoteSourceToString(TapNoteSource
tns) ->
const std::string&;
144TapNoteSourceToLocalizedString(TapNoteSource
tns) ->
const std::string&;
145LuaDeclareType(TapNoteSource);
151 TapNoteType type{ TapNoteType_Empty };
154 TapNoteSubType subType{ TapNoteSubType_Invalid };
156 TapNoteSource source{ TapNoteSource_Original };
161 int iKeysoundIndex{ -1 };
168 [[nodiscard]]
auto CreateNode() const ->
XNode*;
169 void LoadFromNode(const
XNode* pNode);
172 void PushSelf(lua_State* L);
175 [[nodiscard]] auto IsNote() const ->
bool
177 return type == TapNoteType_Tap || type == TapNoteType_HoldHead;
183 type = TapNoteType_Empty;
184 subType = TapNoteSubType_Invalid;
185 source = TapNoteSource_Original;
189 TapNoteSubType subType_,
190 TapNoteSource source_,
195 , iKeysoundIndex(iKeysoundIndex_)
197 if (type_ > TapNoteType_Fake) {
198 Locator::getLogger()->trace(
"Invalid tap note type {} (most likely) due to random "
199 "vanish issues. Assume it doesn't need judging.",
200 TapNoteTypeToString(type_).c_str());
201 type = TapNoteType_Empty;
212 if ((x) != other.x) \
217 COMPARE(iKeysoundIndex);
228 return !operator==(other);
233extern TapNote TAP_ORIGINAL_TAP;
234extern TapNote TAP_ORIGINAL_HOLD_HEAD;
235extern TapNote TAP_ORIGINAL_ROLL_HEAD;
236extern TapNote TAP_ORIGINAL_MINE;
237extern TapNote TAP_ORIGINAL_LIFT;
238extern TapNote TAP_ORIGINAL_ATTACK;
239extern TapNote TAP_ORIGINAL_AUTO_KEYSOUND;
240extern TapNote TAP_ORIGINAL_FAKE;
243extern TapNote TAP_ADDITION_TAP;
244extern TapNote TAP_ADDITION_MINE;
251const int MAX_NOTE_TRACKS = 16;
262const int ROWS_PER_BEAT = 48;
265const int MAX_NOTE_ROW = (1 << 30);
283NoteTypeToString(NoteType nt) ->
const std::string&;
285NoteTypeToLocalizedString(NoteType nt) ->
const std::string&;
286LuaDeclareType(NoteType);
288NoteTypeToBeat(NoteType nt) -> float;
290NoteTypeToRow(NoteType nt) -> int;
292GetNoteType(
int row) -> NoteType;
294BeatToNoteType(
float fBeat) -> NoteType;
296IsNoteOfType(
int row, NoteType t) -> bool;
318BeatToNoteRow(
float fBeatNum) ->
int
320 return lround(fBeatNum * 48.F);
327NoteRowToBeat(
int iRow) ->
float
329 return iRow /
static_cast<float>(ROWS_PER_BEAT);
340ToNoteRow(
int row) ->
int
350ToNoteRow(
float beat) ->
int
352 return BeatToNoteRow(beat);
360ToBeat(
int row) ->
float
362 return NoteRowToBeat(row);
370ToBeat(
float beat) ->
float
385ScalePosition(T start, T length, T newLength, T position) -> T
387 if (position < start)
389 if (position >= start + length)
390 return position - length + newLength;
391 return start + (position - start) * newLength / length;
The result of holding (or letting go of) a hold note.
Definition NoteTypes.h:42
The result of hitting (or missing) a tap note.
Definition NoteTypes.h:13
TapNoteResult()=default
Set up the TapNoteResult with default values. The default offset value should be 1 not 0 as to diffre...
float fTapNoteOffset
Offset, in seconds, for a tap grade.
Definition NoteTypes.h:27
bool bHidden
If the whole row has been judged, all taps on the row will be set to hidden.
Definition NoteTypes.h:31
TapNoteScore tns
The TapNoteScore that was achieved by the player.
Definition NoteTypes.h:19
The various properties of a tap note.
Definition NoteTypes.h:149
auto operator!=(const TapNote &other) const -> bool
Determine if the two TapNotes are not equal to each other.
Definition NoteTypes.h:226
auto operator==(const TapNote &other) const -> bool
Determine if the two TapNotes are equal to each other.
Definition NoteTypes.h:209
TapNoteResult result
The result of hitting or missing the TapNote.
Definition NoteTypes.h:158