RhythmGame 1.4.3
Loading...
Searching...
No Matches
BmsResultCourse.h
Go to the documentation of this file.
1//
2// Created by PC on 17/07/2025.
3//
4
5#ifndef BMSRESULTCOURSE_H
6#define BMSRESULTCOURSE_H
7
8#include "BmsResult.h"
9#include "ChartData.h"
11#include "support/Version.h"
13
14#include <QObject>
15#include <magic_enum/magic_enum.hpp>
16
17namespace gameplay_logic {
18class BmsScore;
19class BmsResultCourse final : public QObject
20{
21 Q_OBJECT
22
26 Q_PROPERTY(double maxPoints READ getMaxPoints NOTIFY changed)
31 Q_PROPERTY(int maxHits READ getMaxHits NOTIFY changed)
37 Q_PROPERTY(int normalNoteCount READ getNormalNoteCount NOTIFY changed)
42 Q_PROPERTY(int scratchCount READ getScratchCount NOTIFY changed)
49 Q_PROPERTY(int lnCount READ getLnCount NOTIFY changed)
55 Q_PROPERTY(int bssCount READ getBssCount NOTIFY changed)
59 Q_PROPERTY(int mineCount READ getMineCount NOTIFY changed)
63 Q_PROPERTY(double points READ getPoints NOTIFY changed)
67 Q_PROPERTY(int maxCombo READ getMaxCombo NOTIFY changed)
73 Q_PROPERTY(
74 QList<int> judgementCounts READ getJudgementCounts NOTIFY changed)
78 Q_PROPERTY(int mineHits READ getMineHits NOTIFY changed)
84 Q_PROPERTY(QString clearType READ getClearType NOTIFY changed)
93 Q_PROPERTY(
94 QList<qint64> randomSequence READ getRandomSequence NOTIFY changed)
102 Q_PROPERTY(int64_t unixTimestamp READ getUnixTimestamp NOTIFY changed)
110 Q_PROPERTY(int64_t length READ getLength NOTIFY changed)
114 Q_PROPERTY(QString guid READ getGuid CONSTANT)
119 Q_PROPERTY(QString sha256 READ getSha256 NOTIFY changed)
124 Q_PROPERTY(QString md5 READ getMd5 NOTIFY changed)
131 Q_PROPERTY(resource_managers::NoteOrderAlgorithm noteOrderAlgorithm READ
137 Q_PROPERTY(resource_managers::NoteOrderAlgorithm noteOrderAlgorithmP2 READ
143 Q_PROPERTY(QString identifier READ getIdentifier NOTIFY changed)
150 Q_PROPERTY(
151 resource_managers::DpOptions dpOptions READ getDpOptions NOTIFY changed)
156 Q_PROPERTY(uint64_t gameVersion READ getGameVersion NOTIFY changed)
164 Q_PROPERTY(
165 gameplay_logic::ChartData::Keymode keymode READ getKeymode NOTIFY changed)
169 Q_PROPERTY(QStringList constraints READ getConstraints NOTIFY changed)
170
172 Q_PROPERTY(QList<BmsResult*> results READ getResults NOTIFY changed)
175 Q_PROPERTY(bool complete READ isComplete NOTIFY changed)
177 Q_PROPERTY(bool replayAvailable READ isReplayAvailable NOTIFY changed)
179 Q_PROPERTY(bool imported READ isImported NOTIFY changed)
180 QString identifier;
181 QList<BmsResult*> results;
182 QString clearType;
183 QList<qint64> randomSequence;
184 QString guid;
185 int maxCombo;
186 QStringList constraints;
187 QList<resource_managers::Trophy> trophies;
188 uint64_t gameVersion;
189 int64_t unixTimestamp = 0;
190
191 public:
192 struct DTO
193 {
194 int64_t id;
195 std::string guid;
196 std::string identifier;
197 std::string scoreGuids;
198 std::string clearType;
200 std::string constraints;
202 int64_t gameVersion;
203 };
204 static auto load(const DTO& dto, const QList<BmsResult*>& results)
205 -> std::unique_ptr<BmsResultCourse>;
206 void save(db::SqliteCppDb& db) const;
207 BmsResultCourse(QString guid,
208 QString identifier,
209 const QList<BmsResult*>& results,
210 QString clearType,
211 int maxCombo,
212 QStringList constraints,
214 QObject* parent = nullptr);
215 auto clone() const -> std::unique_ptr<BmsResultCourse>;
217 bool updateFrom(const BmsResultCourse& other);
218 bool isComplete() const;
219 bool isReplayAvailable() const;
220 bool isImported() const;
221 BmsResultCourse(QString guid,
222 QString identifier,
223 QList<BmsScore*> scores,
224 QString clearType,
225 int maxCombo,
226 QStringList constraints,
227 uint64_t gameVersion = support::currentVersion,
228 QObject* parent = nullptr);
229
230 auto getMaxPoints() const -> double;
231 auto getMaxHits() const -> int;
232 auto getNormalNoteCount() const -> int;
233 auto getScratchCount() const -> int;
234 auto getLnCount() const -> int;
235 auto getBssCount() const -> int;
236 auto getMineCount() const -> int;
237 auto getPoints() const -> double;
238 auto getMaxCombo() const -> int;
239 auto getJudgementCounts() const -> QList<int>;
240 auto getMineHits() const -> int;
241 auto getClearType() const -> const QString&;
242 auto getRandomSequence() -> QList<qint64>;
243 auto getUnixTimestamp() const -> int64_t;
244 auto getGuid() const -> QString;
245 auto getSha256() const -> QString;
246 auto getMd5() const -> QString;
247 auto getNoteOrderAlgorithm() const -> resource_managers::NoteOrderAlgorithm;
248 auto getNoteOrderAlgorithmP2() const
249 -> resource_managers::NoteOrderAlgorithm;
250 auto getGameVersion() const -> uint64_t;
251 auto getResults() const -> const QList<BmsResult*>&;
252 auto getConstraints() const -> QStringList;
253 auto getTrophies() const -> QVariantList;
254 auto getIdentifier() const -> QString;
255 auto getDpOptions() const -> resource_managers::DpOptions;
256 auto getLength() const -> int64_t;
257 auto getKeymode() const -> ChartData::Keymode;
258 signals:
259 void changed();
260};
261} // namespace gameplay_logic
262
263#endif // BMSRESULTCOURSE_H
Database wrapper for SQLiteCpp.
Definition SqliteCppDb.h:30
Definition BmsResultCourse.h:20
QString sha256
The SHA-256 hashes of constituent charts, joined with spaces.
Definition BmsResultCourse.h:119
auto getClearType() const -> const QString &
Definition BmsResultCourse.cpp:292
auto getJudgementCounts() const -> QList< int >
Definition BmsResultCourse.cpp:269
auto getConstraints() const -> QStringList
Definition BmsResultCourse.cpp:374
void save(db::SqliteCppDb &db) const
Definition BmsResultCourse.cpp:35
bool replayAvailable
Definition BmsResultCourse.h:177
auto getPoints() const -> double
Definition BmsResultCourse.cpp:254
QList< qint64 > randomSequence
The random sequence used for parsing the constituent charts.
Definition BmsResultCourse.h:94
auto getMineCount() const -> int
Definition BmsResultCourse.cpp:246
auto getSha256() const -> QString
Definition BmsResultCourse.cpp:319
QString clearType
The clear type achieved in the score.
Definition BmsResultCourse.h:84
resource_managers::NoteOrderAlgorithm noteOrderAlgorithm READ getNoteOrderAlgorithm
The note order algorithm used for the course.
Definition BmsResultCourse.h:132
auto getGuid() const -> QString
Definition BmsResultCourse.cpp:314
auto getUnixTimestamp() const -> int64_t
Definition BmsResultCourse.cpp:309
auto getMd5() const -> QString
Definition BmsResultCourse.cpp:333
double points
The points achieved in the score.
Definition BmsResultCourse.h:63
QString identifier
The unique identifier of the course, based on chart identifiers and contraints.
Definition BmsResultCourse.h:143
auto getScratchCount() const -> int
Definition BmsResultCourse.cpp:221
bool isReplayAvailable() const
Definition BmsResultCourse.cpp:178
int maxHits
The maximum number of possible hits (normal notes + long notes) in the chart.
Definition BmsResultCourse.h:31
auto getMaxHits() const -> int
Definition BmsResultCourse.cpp:204
auto getLnCount() const -> int
Definition BmsResultCourse.cpp:230
int scratchCount
The number of scratch notes in the course.
Definition BmsResultCourse.h:42
int64_t unixTimestamp
The timestamp when the score was achieved, in Unix time.
Definition BmsResultCourse.h:102
bool updateFrom(const BmsResultCourse &other)
Definition BmsResultCourse.cpp:122
auto getResults() const -> const QList< BmsResult * > &
Definition BmsResultCourse.cpp:369
int64_t length
The length of the course in nanoseconds.
Definition BmsResultCourse.h:110
QList< int > judgementCounts
The counts of each judgement type achieved in the score.
Definition BmsResultCourse.h:74
QList< BmsResult * > results
Definition BmsResultCourse.h:172
bool imported
Definition BmsResultCourse.h:179
QString guid
The unique identifier of this course score.
Definition BmsResultCourse.h:114
bool isComplete() const
Definition BmsResultCourse.cpp:170
double maxPoints
The maximum possible points achievable in the score.
Definition BmsResultCourse.h:26
auto getMaxPoints() const -> double
Definition BmsResultCourse.cpp:193
int normalNoteCount
The number of normal notes in the course.
Definition BmsResultCourse.h:37
auto getNormalNoteCount() const -> int
Definition BmsResultCourse.cpp:212
static auto load(const DTO &dto, const QList< BmsResult * > &results) -> std::unique_ptr< BmsResultCourse >
Definition BmsResultCourse.cpp:17
auto getMineHits() const -> int
Definition BmsResultCourse.cpp:284
resource_managers::NoteOrderAlgorithm noteOrderAlgorithmP2 READ getNoteOrderAlgorithmP2
The note order algorithm used for player 2 side in DP charts.
Definition BmsResultCourse.h:138
int mineHits
The number of mines hit in the score.
Definition BmsResultCourse.h:78
auto getIdentifier() const -> QString
Definition BmsResultCourse.cpp:388
auto getBssCount() const -> int
Definition BmsResultCourse.cpp:238
auto getTrophies() const -> QVariantList
Definition BmsResultCourse.cpp:379
uint64_t gameVersion
The game version where the score was achieved.
Definition BmsResultCourse.h:156
int bssCount
The number of BSS (scratch long notes) in the course.
Definition BmsResultCourse.h:55
QStringList constraints
The constraints of the course, like "gauge_lr2" or "grade_mirror".
Definition BmsResultCourse.h:169
QString md5
The MD5 hashes of constituent charts, joined with spaces.
Definition BmsResultCourse.h:124
bool complete
Definition BmsResultCourse.h:175
auto getGameVersion() const -> uint64_t
Definition BmsResultCourse.cpp:364
int maxCombo
The best combo achieved in the score.
Definition BmsResultCourse.h:67
auto getKeymode() const -> ChartData::Keymode
Definition BmsResultCourse.cpp:411
auto getRandomSequence() -> QList< qint64 >
Definition BmsResultCourse.cpp:297
auto clone() const -> std::unique_ptr< BmsResultCourse >
Definition BmsResultCourse.cpp:160
auto getDpOptions() const -> resource_managers::DpOptions
Definition BmsResultCourse.cpp:393
resource_managers::DpOptions dpOptions
The DP options used for the score.
Definition BmsResultCourse.h:151
int lnCount
The number of long notes in the course excluding BSS (scratch lns).
Definition BmsResultCourse.h:49
int mineCount
The number of mines (landmines) in the course.
Definition BmsResultCourse.h:59
auto getMaxCombo() const -> int
Definition BmsResultCourse.cpp:264
bool isImported() const
Definition BmsResultCourse.cpp:186
gameplay_logic::ChartData::Keymode keymode
The keymode of the chart.
Definition BmsResultCourse.h:165
auto getLength() const -> int64_t
Definition BmsResultCourse.cpp:401
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
Namespace for database related classes and functions.
Definition QtArenaRoundLoader.h:15
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
Contains various helper classes and functions.
Definition Capitalize.h:9
constexpr uint64_t currentVersion
Definition Version.h:31
Definition BmsResultCourse.h:193
std::string identifier
Definition BmsResultCourse.h:196
int64_t id
Definition BmsResultCourse.h:194
std::string scoreGuids
Definition BmsResultCourse.h:197
int maxCombo
Definition BmsResultCourse.h:199
int64_t gameVersion
Definition BmsResultCourse.h:202
std::string guid
Definition BmsResultCourse.h:195
std::string constraints
Definition BmsResultCourse.h:200
std::string clearType
Definition BmsResultCourse.h:198
int64_t unixTimestamp
Definition BmsResultCourse.h:201