RhythmGame 1.4.3
Loading...
Searching...
No Matches
BmsLiveScore.h
Go to the documentation of this file.
1//
2// Created by bobini on 25.06.23.
3//
4
5#ifndef RHYTHMGAME_BMSSCORE_H
6#define RHYTHMGAME_BMSSCORE_H
7#include <magic_enum/magic_enum.hpp>
9#include "HitEvent.h"
10#include "BmsResult.h"
11#include "BmsGaugeHistory.h"
12#include "BmsReplayData.h"
13#include "BmsScore.h"
14#include "ChartData.h"
16
17#include <QAbstractListModel>
18#include <QUuid>
19
20namespace gameplay_logic {
21
22class JudgementCounts : public QAbstractListModel
23{
24 Q_OBJECT
25
26 QList<int> judgementCounts =
27 QList<int>(magic_enum::enum_count<Judgement>());
28
29 public:
30 explicit JudgementCounts(QObject* parent = nullptr);
31
32 auto rowCount(const QModelIndex& parent = QModelIndex()) const
33 -> int override;
34
35 enum Roles
36 {
37 JudgementRole = Qt::UserRole + 1,
39 };
40
41 auto roleNames() const -> QHash<int, QByteArray> override;
42
43 auto data(const QModelIndex& index, int role) const -> QVariant override;
44
45 void addJudgement(Judgement judgement);
46
47 auto getJudgementCounts() const -> const QList<int>&;
48};
49
56class BmsLiveScore final : public QObject
57{
58 Q_OBJECT
59
63 Q_PROPERTY(double maxPoints READ getMaxPoints CONSTANT)
68 Q_PROPERTY(
69 double maxPointsNow READ getMaxPointsNow NOTIFY maxPointsNowChanged)
75 Q_PROPERTY(int normalNoteCount READ getNormalNoteCount CONSTANT)
80 Q_PROPERTY(int scratchCount READ getScratchCount CONSTANT)
86 Q_PROPERTY(int lnCount READ getLnCount CONSTANT)
92 Q_PROPERTY(int bssCount READ getBssCount CONSTANT)
96 Q_PROPERTY(int mineCount READ getMineCount CONSTANT)
101 Q_PROPERTY(int maxHits READ getMaxHits CONSTANT)
105 Q_PROPERTY(double points READ getPoints NOTIFY pointsChanged)
109 Q_PROPERTY(int combo READ getCombo NOTIFY comboChanged)
113 Q_PROPERTY(int maxCombo READ getMaxCombo NOTIFY maxComboChanged)
122 Q_PROPERTY(
123 JudgementCounts* judgementCounts READ getJudgementCounts CONSTANT)
127 Q_PROPERTY(int mineHits READ getMineHits NOTIFY mineHitsChanged)
138 Q_PROPERTY(QList<rules::BmsGauge*> gauges READ getGauges CONSTANT)
147 Q_PROPERTY(QList<qint64> randomSequence READ getRandomSequence CONSTANT)
154 Q_PROPERTY(resource_managers::note_order_algorithm::NoteOrderAlgorithm
155 noteOrderAlgorithm READ getNoteOrderAlgorithm CONSTANT)
160 Q_PROPERTY(resource_managers::note_order_algorithm::NoteOrderAlgorithm
161 noteOrderAlgorithmP2 READ getNoteOrderAlgorithmP2 CONSTANT)
168 Q_PROPERTY(QList<int> permutation READ getPermutation CONSTANT)
179 Q_PROPERTY(uint64_t randomSeed READ getRandomSeed CONSTANT)
185 Q_PROPERTY(QString guid READ getGuid CONSTANT)
192 Q_PROPERTY(
193 gameplay_logic::ChartData::Keymode keymode READ getKeymode CONSTANT)
194
195 double maxHitValue;
196 double maxPoints;
197 int mineCount;
198 int normalNoteCount;
199 int scratchCount;
200 int lnCount;
201 int bssCount;
202 int maxHits;
203 QList<HitEvent> hits;
204 QList<rules::BmsGauge*> gauges;
205 JudgementCounts judgementCounts;
206 QList<qint64> randomSequence;
207 resource_managers::NoteOrderAlgorithm noteOrderAlgorithm;
208 resource_managers::NoteOrderAlgorithm noteOrderAlgorithmP2;
209 resource_managers::DpOptions dpOptions;
210 QList<int> permutation;
211 QString sha256;
212 QString md5;
213 QString guid;
214 ChartData::Keymode keymode;
215 double points = 0;
216 double maxPointsNow = 0;
217 int combo = 0;
218 int maxCombo = 0;
219 int mineHits = 0;
220 uint64_t randomSeed;
221 int64_t length;
222 int64_t savedTimestamp;
223 BmsScore::SubmissionState submissionState;
224
225 void resetCombo();
226 void increaseCombo();
227
228 public:
229 void addHit(const HitEvent& tap);
231 int scratchCount,
232 int lnCount,
233 int bssCount,
234 int mineCount,
235 int maxHits,
236 double maxHitValue,
237 QList<rules::BmsGauge*> gauges,
238 QList<qint64> randomSequence,
239 resource_managers::NoteOrderAlgorithm noteOrderAlgorithm,
240 resource_managers::NoteOrderAlgorithm noteOrderAlgorithmP2,
241 resource_managers::DpOptions dpOptions,
242 QList<int> permutation,
243 uint64_t seed,
244 int64_t length,
245 QString sha256,
246 QString md5,
247 ChartData::Keymode keymode,
248 int64_t savedTimestamp, // for replays
249 QString guid = QUuid::createUuid().toString(),
250 BmsScore::SubmissionState submissionState =
251 BmsScore::SubmissionState::NotSubmitted,
252 QObject* parent = nullptr);
253
254 auto getMaxPoints() const -> double;
255 auto getMaxHits() const -> int;
256 auto getNormalNoteCount() const -> int;
257 auto getScratchCount() const -> int;
258 auto getLnCount() const -> int;
259 auto getBssCount() const -> int;
260 auto getMineCount() const -> int;
261 auto getPoints() const -> double;
262 auto getMaxPointsNow() const -> double;
264 auto getJudgementCounts() const -> const JudgementCounts*;
265 Q_INVOKABLE int judgementCount(int judgement) const;
266 void sendVisualOnlyTap(HitEvent tap);
267 void sendVisualOnlyRelease(const HitEvent& release);
268 auto getCombo() const -> int;
269 auto getMaxCombo() const -> int;
270 auto getMineHits() const -> int;
271 auto getGauges() const -> QList<rules::BmsGauge*>;
272 auto getRandomSequence() const -> const QList<qint64>&;
273 auto getNoteOrderAlgorithm() const -> resource_managers::NoteOrderAlgorithm;
274 auto getNoteOrderAlgorithmP2() const
275 -> resource_managers::NoteOrderAlgorithm;
276 auto getDpOptions() const -> resource_managers::DpOptions;
277 auto getPermutation() const -> const QList<int>&;
278 auto getRandomSeed() const -> uint64_t;
279 auto getGuid() const -> QString;
280 auto getKeymode() const -> ChartData::Keymode;
281
282 auto getResult() const -> std::unique_ptr<BmsResult>;
283 auto getReplayData() const -> std::unique_ptr<BmsReplayData>;
284 auto getGaugeHistory() const -> std::unique_ptr<BmsGaugeHistory>;
285
286 signals:
287 void pointsChanged();
288 void comboChanged();
289 void comboDropped();
290 void comboIncreased();
291 void maxComboChanged();
292 void mineHitsChanged();
293 void maxPointsNowChanged();
294
295 void hit(HitEvent hit);
296};
297
298} // namespace gameplay_logic
299
300#endif // RHYTHMGAME_BMSSCORE_H
QString md5
Definition BeatorajaReplayImporter.cpp:73
QString sha256
Definition BeatorajaReplayImporter.cpp:72
QList< qint64 > randomSequence
Definition BeatorajaReplayImporter.cpp:74
std::optional< BmsPoints > points
Definition BmsReplayData.cpp:39
int64_t length
Definition ImportedScoreImporter.cpp:39
int maxHits
Definition ImportedScoreImporter.cpp:55
int keymode
Definition ImportedScoreImporter.cpp:40
int bssCount
Definition ImportedScoreImporter.cpp:37
int normalNoteCount
Definition ImportedScoreImporter.cpp:34
int maxCombo
Definition ImportedScoreImporter.cpp:57
int mineCount
Definition ImportedScoreImporter.cpp:38
int scratchCount
Definition ImportedScoreImporter.cpp:35
int lnCount
Definition ImportedScoreImporter.cpp:36
QByteArray data
Definition Lr2FontCache.cpp:25
double maxPoints
Definition ScoreDb.cpp:71
zip_uint64_t index
Definition SongAssetStore.cpp:436
The history of all gauges used in a BMS score.
Definition BmsGaugeHistory.h:67
The score that gets updated during gameplay.
Definition BmsLiveScore.h:57
Definition BmsReplayData.h:18
The aggregated info about a score.
Definition BmsResult.h:23
The result of playing a chart.
Definition BmsScore.h:16
Metadata and basic stats of a chart.
Definition ChartData.h:28
A very generic event that happened during gameplay.
Definition HitEvent.h:19
Definition BmsLiveScore.h:23
auto getJudgementCounts() const -> const QList< int > &
Definition BmsLiveScore.cpp:281
auto rowCount(const QModelIndex &parent=QModelIndex()) const -> int override
Definition BmsLiveScore.cpp:248
auto roleNames() const -> QHash< int, QByteArray > override
Definition BmsLiveScore.cpp:253
Roles
Definition BmsLiveScore.h:36
@ CountRole
Definition BmsLiveScore.h:38
@ JudgementRole
Definition BmsLiveScore.h:37
void addJudgement(Judgement judgement)
Definition BmsLiveScore.cpp:273
Judgement
The possible judgements for note hits.
Definition Judgement.h:18
Classes and functions mostly related to gameplay.
Definition ArenaGameplaySource.h:10
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12