Etterna 0.74.4
Loading...
Searching...
No Matches
ScoreKeeper.h
1#ifndef SCORE_KEEPER_H
2#define SCORE_KEEPER_H
3
4#include "Etterna/Models/Misc/GameConstantsAndTypes.h"
5
6class NoteData;
7class Song;
8class Steps;
9class PlayerState;
11struct TapNote;
12
20{
21 public:
22 static auto MakeScoreKeeper(const std::string& sClassName,
23 PlayerState* pPlayerState,
24 PlayerStageStats* pPlayerStageStats)
25 -> ScoreKeeper*;
26
27 protected:
28 PlayerState* m_pPlayerState;
29 PlayerStageStats* m_pPlayerStageStats;
30
31 // Common toggles that this class handles directly:
32
33 /* If true, doubles count as 2+ in stat counts; if false, doubles count as
34 * only one. */ /* (not yet) */
35 // bool Stats_DoublesCount;
36
37 public:
38 ScoreKeeper(PlayerState* pPlayerState, PlayerStageStats* pPlayerStageStats);
39 virtual ~ScoreKeeper() = default;
40 virtual void Load(const std::vector<Song*>& /*unused*/,
41 const std::vector<Steps*>& /*unused*/)
42 {
43 }
44
45 virtual void DrawPrimitives() {}
46 virtual void Update(float /* fDelta */) {}
47
48 // Note that pNoteData will include any transformations due to modifiers.
49 virtual void OnNextSong(
50 int /* iSongInCourseIndex */,
51 const Steps* /*unused*/,
52 const NoteData* /*unused*/){}; // before a song plays (called
53 // multiple times if course)
54
55 // HandleTap* is called before HandleTapRow*
56 virtual void HandleTapScore(const TapNote& /*unused*/) {}
57 virtual void HandleTapRowScore(const NoteData& /* nd */, int /* iRow */) {}
58 virtual void HandleHoldScore(const TapNote& /*unused*/) {}
59 virtual void HandleHoldActiveSeconds(float /* fMusicSecondsHeld */) {}
60 virtual void HandleHoldCheckpointScore(const NoteData& /*nd */,
61 int /* iRow */,
62 int /* iNumHoldsHeldThisRow */,
63 int /* iNumHoldsMissedThisRow */)
64 {
65 }
66 virtual void HandleTapScoreNone() {}
67
68 protected:
69 void GetScoreOfLastTapInRow(const NoteData& nd,
70 int iRow,
71 TapNoteScore& tnsOut,
72 int& iNumTapsInRowOut);
73};
74
75#endif
Holds data about the notes that the player is supposed to hit.
Definition NoteData.h:43
Contains statistics for one stage of play - either one song, or a whole course.
Definition PlayerStageStats.h:19
The player's indivdual state.
Definition PlayerState.h:30
Abstract class to handle scorekeeping, stat-taking, etc.
Definition ScoreKeeper.h:20
Holds all music metadata and steps for one song.
Definition Song.h:65
Holds note information for a Song.
Definition Steps.h:42
The various properties of a tap note.
Definition NoteTypes.h:149