5#ifndef RHYTHMGAME_CHART_H
6#define RHYTHMGAME_CHART_H
22#include <QFutureWatcher>
95 QTimer propertyUpdateTimer;
96 std::chrono::steady_clock::time_point startTimepoint;
99 QFuture<std::unique_ptr<qml_components::BgaContainer>> bgaFuture;
103 ChartStartGate startGate;
106 static constexpr auto physicalKeyCount =
108 std::array<bool, physicalKeyCount> pressedInputKeys{};
109 bool m_inputSuppressed{};
111 void updateElapsed();
113 void clearPressedInputKeys();
114 int numberOfSetupCalls = 0;
115 void setStatus(
Status ready);
121 QFuture<std::unique_ptr<qml_components::BgaContainer>> bgaFuture,
125 QObject* parent =
nullptr);
127 Q_INVOKABLE
void start();
134 Q_INVOKABLE QList<BmsScore*>
finish();
137 auto
getKeymode() const -> ChartData::Keymode;
186 Q_PROPERTY(QList<
int> columns READ getColumns CONSTANT)
194 Q_PROPERTY(
double position READ getPosition NOTIFY positionChanged)
199 double beatPosition READ getBeatPosition NOTIFY beatPositionChanged)
203 Q_PROPERTY(
double bpm READ getBpm NOTIFY bpmChanged)
207 Q_PROPERTY(
double scroll READ getScroll NOTIFY scrollChanged)
213 Q_PROPERTY(
double speedMultiplier READ getSpeedMultiplier NOTIFY
214 speedMultiplierChanged)
218 Q_PROPERTY(int64_t elapsed READ getElapsed NOTIFY elapsedChanged)
226 Q_PROPERTY(int64_t chartLength READ getChartLength CONSTANT)
235 std::chrono::nanoseconds chartLength;
238 double speedMultiplier = 1.0;
240 void setElapsed(int64_t newElapsed);
243 void setBpm(
double newBpm);
244 void setScroll(
double second);
246 -> BmsGameReferee::PositionInfo;
249 QFuture<BmsGameReferee> refereeFuture;
260 QFuture<BmsGameReferee> referee,
261 std::chrono::nanoseconds chartLength,
263 QObject* parent =
nullptr);
268 std::chrono::nanoseconds offset);
273 auto getColumns() const -> QList<
int>;
275 Q_INVOKABLE
bool isScratchColumn(
int column) const;
277 auto getPosition() const ->
double;
278 auto getBeatPosition() const ->
double;
279 auto positionAt(std::chrono::nanoseconds
offsetFromStart) const ->
double;
282 auto hasSpeedChanges() const ->
bool;
283 auto getSpeedMultiplier() const ->
double {
return speedMultiplier; }
286 auto getElapsed() const -> int64_t;
289 auto getChartLength() const -> int64_t;
290 auto getBpm() const ->
double;
291 auto getScroll() const ->
double;
295 void positionChanged(
double delta);
296 void beatPositionChanged(
double delta);
297 void elapsedChanged(int64_t delta);
299 void scrollChanged();
300 void speedMultiplierChanged();
315 Q_PROPERTY(
BmsScore* replayedScore READ getReplayedScore CONSTANT)
318 std::span<const HitEvent>
events;
325 QFuture<BmsGameReferee> referee,
326 std::chrono::nanoseconds chartLength,
329 QObject* parent =
nullptr);
332 std::chrono::nanoseconds offset)
override;
334 bool lastUpdate)
override;
335 auto getReplayedScore() const ->
BmsScore*;
346 std::vector<HitEvent> eventsVec;
347 std::span<const HitEvent>
events;
354 QFuture<BmsGameReferee> referee,
355 std::chrono::nanoseconds chartLength,
357 std::vector<HitEvent>
events,
358 QObject* parent =
nullptr);
361 std::chrono::nanoseconds offset)
override;
363 bool lastUpdate)
override;
int column
Definition BmsReplayData.cpp:41
int64_t offsetFromStart
Definition BmsReplayData.cpp:38
std::vector< ChartAudioEvent > events
Definition ChartAudioPlayer.cpp:32
Definition QtArenaRoundLoader.h:29
A player that plays automatically, hitting all notes perfectly.
Definition ChartRunner.h:344
The update manager of notes and sounds during gameplay.
Definition BmsGameReferee.h:27
double Position
Definition BmsGameReferee.h:50
The score that gets updated during gameplay.
Definition BmsLiveScore.h:57
Definition BmsNotes.h:155
The result of playing a chart.
Definition BmsScore.h:16
Metadata and basic stats of a chart.
Definition ChartData.h:28
Keymode
Definition ChartData.h:38
The main class responsible for running a chart during gameplay.
Definition ChartRunner.h:35
ChartData * chartData
The chart data of the chart being played.
Definition ChartRunner.h:59
auto getPlayer2() const -> Player *
Definition ChartRunner.cpp:391
auto getBga() const -> qml_components::BgaContainer *
Definition ChartRunner.cpp:381
auto currentOffsetFromStart() const -> std::chrono::nanoseconds
Definition ChartRunner.cpp:427
void inputMappingChanged()
void holdStart()
Definition ChartRunner.cpp:125
Q_INVOKABLE QList< BmsScore * > finish()
Definition ChartRunner.cpp:337
QList< int > inputMapping
Mapping of BmsKey to column index. Usually iota by default except in 10k mode, where the P2 side has ...
Definition ChartRunner.h:93
auto inputSuppressed() const -> bool
Definition ChartRunner.cpp:253
bool startPending
Definition ChartRunner.h:65
Status status
The current status of the chart runner.
Definition ChartRunner.h:63
Q_INVOKABLE void start()
Definition ChartRunner.cpp:104
ChartRunner(ChartData *chartData, QFuture< std::unique_ptr< qml_components::BgaContainer > > bgaFuture, ChartData::Keymode keymode, Player *player1, Player *player2, QObject *parent=nullptr)
Definition ChartRunner.cpp:59
void startPendingChanged()
void passKey(input::BmsKey key, EventType eventType, int64_t time)
Definition ChartRunner.cpp:175
void releaseStart()
Definition ChartRunner.cpp:133
qml_components::BgaContainer * bga
The BGA object. Initially null.
Definition ChartRunner.h:61
auto getChartData() const -> ChartData *
Definition ChartRunner.cpp:284
auto getInputMapping() const -> QList< int >
Definition ChartRunner.cpp:396
auto getStatus() const -> Status
Definition ChartRunner.cpp:294
auto getKeymode() const -> ChartData::Keymode
Definition ChartRunner.cpp:289
gameplay_logic::ChartData::Keymode keymode
The keymode of the chart being played.
Definition ChartRunner.h:74
void setInputMapping(QList< int > inputMapping)
Definition ChartRunner.cpp:401
void setInputSuppressed(bool suppressed)
Definition ChartRunner.cpp:259
auto getPlayer1() const -> Player *
Definition ChartRunner.cpp:386
EventType
Definition ChartRunner.h:40
Status
Definition ChartRunner.h:46
@ Ready
Definition ChartRunner.h:48
@ Loading
Definition ChartRunner.h:47
@ Running
Definition ChartRunner.h:49
@ Finished
Definition ChartRunner.h:50
The state of gameplay columns and barlines.
Definition NoteState.h:250
A player of a chart.
Definition ChartRunner.h:164
std::optional< BmsGameReferee > referee
Definition ChartRunner.h:253
A player that replays a recorded score.
Definition ChartRunner.h:310
Classes and functions mostly related to gameplay.
Definition ArenaGameplaySource.h:10
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12