RhythmGame 1.4.3
Loading...
Searching...
No Matches
ChartPlayConfig.h
Go to the documentation of this file.
1#ifndef RHYTHMGAME_CHARTPLAYCONFIG_H
2#define RHYTHMGAME_CHARTPLAYCONFIG_H
3
4#include "Vars.h"
5
6#include <QList>
7
8#include <cstdint>
9#include <utility>
10
11namespace resource_managers {
12
13inline constexpr auto chartRandomizationVersion = 1;
14
17{
18 QList<qint64> randomSequence;
19 NoteOrderAlgorithm noteOrderP1{ NoteOrderAlgorithm::Normal };
20 NoteOrderAlgorithm noteOrderP2{ NoteOrderAlgorithm::Normal };
21 DpOptions dpMode{ DpOptions::Off };
22 std::uint64_t laneSeed{};
24
25 [[nodiscard]] auto isSupported() const -> bool
26 {
28 }
29
30 bool operator==(const ChartPlayConfig&) const = default;
31};
32
39{
40 QList<qint64> values;
41 qsizetype cursor{};
42 bool valid{ true };
43
44 public:
45 explicit ExactRandomSequence(QList<qint64> values)
46 : values(std::move(values))
47 {
48 }
49
50 [[nodiscard]] auto next(qint64 upperBound) -> qint64
51 {
52 if (cursor >= values.size()) {
53 valid = false;
54 return 1;
55 }
56 const auto value = values[cursor++];
57 if (value < 1 || value > upperBound) {
58 valid = false;
59 return 1;
60 }
61 return value;
62 }
63
64 [[nodiscard]] auto complete() const -> bool
65 {
66 return valid && cursor == values.size();
67 }
68};
69
70} // namespace resource_managers
71
72#endif // RHYTHMGAME_CHARTPLAYCONFIG_H
double value
Definition BmsNotesData.cpp:35
Definition ChartPlayConfig.h:39
auto next(qint64 upperBound) -> qint64
Definition ChartPlayConfig.h:50
auto complete() const -> bool
Definition ChartPlayConfig.h:64
ExactRandomSequence(QList< qint64 > values)
Definition ChartPlayConfig.h:45
DpOptions
Definition Vars.h:65
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12
constexpr auto chartRandomizationVersion
Definition ChartPlayConfig.h:13
Definition ChartPlayConfig.h:17
NoteOrderAlgorithm noteOrderP2
Definition ChartPlayConfig.h:20
bool operator==(const ChartPlayConfig &) const =default
DpOptions dpMode
Definition ChartPlayConfig.h:21
int randomizationVersion
Definition ChartPlayConfig.h:23
NoteOrderAlgorithm noteOrderP1
Definition ChartPlayConfig.h:19
QList< qint64 > randomSequence
Definition ChartPlayConfig.h:18
auto isSupported() const -> bool
Definition ChartPlayConfig.h:25
std::uint64_t laneSeed
Definition ChartPlayConfig.h:22