RhythmGame 1.4.3
Loading...
Searching...
No Matches
ChartDataFactory.h
Go to the documentation of this file.
1//
2// Created by bobini on 23.08.23.
3//
4
5#ifndef RHYTHMGAME_CHARTDATAFACTORY_H
6#define RHYTHMGAME_CHARTDATAFACTORY_H
7
11#include <atomic>
12
18namespace resource_managers {
19
20class SongAssetStore;
21
23{
24 static auto loadFile(const QUrl& chartPath) -> std::string;
25 static auto convertToQList(
26 const std::vector<charts::BmsNotesData::Note>& column)
27 -> QVector<gameplay_logic::Note>;
28
29 public:
30 static auto isChartFile(const std::filesystem::path& path) -> bool;
34 {
35 std::unique_ptr<gameplay_logic::ChartData> chartData;
37 std::unordered_map<uint64_t, std::filesystem::path> wavs;
38 std::unordered_map<uint64_t, std::filesystem::path> bmps;
39
41 std::unique_ptr<gameplay_logic::ChartData> chartData,
43 std::unordered_map<uint64_t, std::filesystem::path> wavs,
44 std::unordered_map<uint64_t, std::filesystem::path> bmps);
45 ChartComponents(const ChartComponents& other);
46 ChartComponents(ChartComponents&& other) noexcept;
47 auto operator=(const ChartComponents& other) -> ChartComponents&;
48 auto operator=(ChartComponents&& other) noexcept -> ChartComponents&;
49 };
50 static auto makeNotes(
51 const std::array<std::vector<charts::BmsNotesData::Note>,
53 const std::vector<charts::BmsNotesData::Time>& barLines)
54 -> std::unique_ptr<gameplay_logic::BmsNotes>;
55 void handleImplicitSubtitle(QString& title, QString& subtitle) const;
56 auto loadChartData(const std::filesystem::path& chartPath,
58 int64_t directory = 0) const -> ChartComponents;
59 auto loadChartData(SongAssetStore& assets,
60 const std::filesystem::path& chartPath,
62 std::atomic_bool* stop = nullptr) const
64 auto loadChartData(std::string_view chart,
65 const std::filesystem::path& virtualChartPath,
67 int64_t directory = 0) const -> ChartComponents;
68 auto loadBmsonChartData(const std::filesystem::path& chartPath,
69 int64_t directory = 0) const -> ChartComponents;
70 auto loadBmsonChartData(std::string_view chart,
71 const std::filesystem::path& virtualChartPath,
72 int64_t directory = 0) const -> ChartComponents;
73
74 private:
75 struct ChartMetadata
76 {
77 QString title;
78 QString artist;
79 QString subtitle;
80 QString subartist;
81 QString genre;
82 QString stageFile;
83 QString banner;
84 QString backBmp;
85 double rank = 75.0;
86 double total = -1.0; // negative means "use default"
87 int playLevel = 1;
88 int difficulty = 1;
89 bool isRandom = false;
90 QList<qint64> randomSequence;
91 QString sha256;
92 QString md5;
93 };
94 static auto buildChartComponents(
95 charts::BmsNotesData calculatedNotesData,
96 ChartMetadata metadata,
97 std::unordered_map<uint64_t, std::filesystem::path> wavs,
98 std::unordered_map<uint64_t, std::filesystem::path> bmps,
99 const std::filesystem::path& chartPath,
100 int64_t directory,
101 bool bmson) -> ChartComponents;
102};
103
104} // namespace resource_managers
105
106#endif // RHYTHMGAME_CHARTDATAFACTORY_H
QString md5
Definition BeatorajaReplayImporter.cpp:73
QString sha256
Definition BeatorajaReplayImporter.cpp:72
QList< qint64 > randomSequence
Definition BeatorajaReplayImporter.cpp:74
int column
Definition BmsReplayData.cpp:41
bool banner
Definition Lr2SkinModel.cpp:16
bool backBmp
Definition Lr2SkinModel.cpp:15
bool stageFile
Definition Lr2SkinModel.cpp:14
QString path
Definition Lr2SkinParser.cpp:87
std::filesystem::path directory
Definition Lr2SkinParser.cpp:73
std::function< ParsedBmsChart::RandomRange(ParsedBmsChart::RandomRange)> randomGenerator
Definition ReadBmsFile.cpp:74
Definition ChartDataFactory.h:23
std::function< charts::ParsedBmsChart::RandomRange(charts::ParsedBmsChart::RandomRange)> RandomGenerator
Definition ChartDataFactory.h:32
auto loadChartData(const std::filesystem::path &chartPath, RandomGenerator randomGenerator, int64_t directory=0) const -> ChartComponents
Definition ChartDataFactory.cpp:389
auto loadBmsonChartData(const std::filesystem::path &chartPath, int64_t directory=0) const -> ChartComponents
Definition ChartDataFactory.cpp:471
static auto makeNotes(const std::array< std::vector< charts::BmsNotesData::Note >, charts::BmsNotesData::columnNumber > &notes, const std::vector< charts::BmsNotesData::Time > &barLines) -> std::unique_ptr< gameplay_logic::BmsNotes >
Definition ChartDataFactory.cpp:109
static auto isChartFile(const std::filesystem::path &path) -> bool
Definition ChartDataFactory.cpp:31
void handleImplicitSubtitle(QString &title, QString &subtitle) const
Definition ChartDataFactory.cpp:310
Definition SongAssetStore.h:28
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12
Definition BmsNotesData.h:21
static constexpr auto columnNumber
Definition BmsNotesData.h:101
int64_t RandomRange
Definition ParsedBmsChart.h:20
charts::BmsNotesData notesData
Definition ChartDataFactory.h:36
auto operator=(const ChartComponents &other) -> ChartComponents &
Definition ChartDataFactory.cpp:87
std::unordered_map< uint64_t, std::filesystem::path > wavs
Definition ChartDataFactory.h:37
std::unordered_map< uint64_t, std::filesystem::path > bmps
Definition ChartDataFactory.h:38
std::unique_ptr< gameplay_logic::ChartData > chartData
Definition ChartDataFactory.h:35