|
RhythmGame 1.4.3
|
Loads charts and courses with the given parameters. More...
#include <ChartLoader.h>


Public Types | |
| using | GaugeFactory = std::function< QList< gameplay_logic::rules::BmsGauge * >(resource_managers::Profile *profile, double total, int noteCount)> |
| using | GaugeFactoryCourse = std::function< QList< gameplay_logic::rules::BmsGauge * >(resource_managers::Profile *profile, const QHash< QString, double > &initialValues)> |
| using | HitValueFactory = std::function< double(std::chrono::nanoseconds, gameplay_logic::Judgement)> |
| using | FindChartPath = std::function< std::optional< std::filesystem::path >(const QString &hash, const std::filesystem::path &hint)> |
Public Member Functions | |
| ChartLoader (ProfileList *profileList, input::InputTranslator *inputTranslator, resource_managers::ChartDataFactory *chartDataFactory, resource_managers::SongAssetStore *assetStore, HitValueFactory hitValueFactory, GaugeFactory gaugeFactory, GaugeFactoryCourse gaugeFactoryCourse, FindChartPath findChartPath, resource_managers::ChartFactory *chartFactory, db::SqliteCppDb *db, QObject *parent=nullptr) | |
| Q_INVOKABLE gameplay_logic::ChartRunner * | loadChart (const QString &filename, resource_managers::Profile *player1, bool player1AutoPlay, bool player1Replay, gameplay_logic::BmsScore *score1, resource_managers::Profile *player2, bool player2AutoPlay, bool player2Replay, gameplay_logic::BmsScore *score2) const |
| Loads a chart with the given parameters. | |
| auto | loadChartWithConfig (const QString &filename, resource_managers::Profile *player, const resource_managers::ChartPlayConfig &playConfig) const -> gameplay_logic::ChartRunner * |
| Q_INVOKABLE bool | canRetry (gameplay_logic::ChartRunner *current) const |
| Q_INVOKABLE gameplay_logic::ChartRunner * | retryChart (gameplay_logic::ChartRunner *current, bool samePattern) const |
| Q_INVOKABLE gameplay_logic::CourseRunner * | loadCourse (const resource_managers::Course &course, resource_managers::Profile *player1, bool player1AutoPlay, bool player1Replay, gameplay_logic::BmsScoreCourse *score1, resource_managers::Profile *player2, bool player2AutoPlay, bool player2Replay, gameplay_logic::BmsScoreCourse *score2) const |
| Loads a course with the given parameters. | |
| Q_INVOKABLE gameplay_logic::ChartData * | loadChartData (const QString &filename, const QString &identifier="", QList< int64_t > randomSequence={}) const |
| Q_INVOKABLE QVariantMap | loadChartDataFromDb (QList< QString > identifiers) const |
| Loads chart datas for multiple charts from the database. | |
Loads charts and courses with the given parameters.
This class is how a theme to load charts and courses.
| using qml_components::ChartLoader::FindChartPath = std::function<std::optional<std::filesystem::path>( const QString& hash, const std::filesystem::path& hint)> |
| using qml_components::ChartLoader::GaugeFactory = std::function<QList<gameplay_logic::rules::BmsGauge*>( resource_managers::Profile* profile, double total, int noteCount)> |
| using qml_components::ChartLoader::GaugeFactoryCourse = std::function<QList<gameplay_logic::rules::BmsGauge*>( resource_managers::Profile* profile, const QHash<QString, double>& initialValues)> |
| using qml_components::ChartLoader::HitValueFactory = std::function<double(std::chrono::nanoseconds, gameplay_logic::Judgement)> |
| qml_components::ChartLoader::ChartLoader | ( | ProfileList * | profileList, |
| input::InputTranslator * | inputTranslator, | ||
| resource_managers::ChartDataFactory * | chartDataFactory, | ||
| resource_managers::SongAssetStore * | assetStore, | ||
| HitValueFactory | hitValueFactory, | ||
| GaugeFactory | gaugeFactory, | ||
| GaugeFactoryCourse | gaugeFactoryCourse, | ||
| FindChartPath | findChartPath, | ||
| resource_managers::ChartFactory * | chartFactory, | ||
| db::SqliteCppDb * | db, | ||
| QObject * | parent = nullptr |
||
| ) |
| auto qml_components::ChartLoader::canRetry | ( | gameplay_logic::ChartRunner * | current | ) | const |
Whether this is a single-player chart without autoplay or replay.
| auto qml_components::ChartLoader::loadChart | ( | const QString & | filename, |
| resource_managers::Profile * | player1, | ||
| bool | player1AutoPlay, | ||
| bool | player1Replay, | ||
| gameplay_logic::BmsScore * | score1, | ||
| resource_managers::Profile * | player2, | ||
| bool | player2AutoPlay, | ||
| bool | player2Replay, | ||
| gameplay_logic::BmsScore * | score2 | ||
| ) | const |
Loads a chart with the given parameters.
| filename | The path to the chart file. |
| player1 | The first player profile. |
| player1AutoPlay | Whether the first player is in auto-play mode. |
| player1Replay | Whether the first player is in replay mode. |
| score1 | The score to replay for the first player, optional. Incompatible with auto-play. |
| player2 | The second player profile, can be nullptr for single-player. |
| player2AutoPlay | Whether the second player is in auto-play mode. |
| player2Replay | Whether the second player is in replay mode. |
| score2 | The score to replay for the second player. Incompatible with auto-play. |
If score is not null and replay is false, the game will load the chart with the same settings the score (G-Battle).
| gameplay_logic::ChartData * qml_components::ChartLoader::loadChartData | ( | const QString & | filename, |
| const QString & | identifier = "", |
||
| QList< int64_t > | randomSequence = {} |
||
| ) | const |
| filename | The path to the chart file, optional if identifier is given. |
| identifier | An MD5 hash or sha256/<hash>, optional if filename is given. |
| randomSequence | The #RANDOM sequence to use for the chart, optional. |
| auto qml_components::ChartLoader::loadChartDataFromDb | ( | QList< QString > | identifiers | ) | const |
Loads chart datas for multiple charts from the database.
| identifiers | MD5 hashes or sha256/<hash> identifiers. |
| auto qml_components::ChartLoader::loadChartWithConfig | ( | const QString & | filename, |
| resource_managers::Profile * | player, | ||
| const resource_managers::ChartPlayConfig & | playConfig | ||
| ) | const -> gameplay_logic::ChartRunner* |
Loads a single-player chart with an explicit immutable transformation. This path never reads or writes the profile's note-order/DP options.
| gameplay_logic::CourseRunner * qml_components::ChartLoader::loadCourse | ( | const resource_managers::Course & | course, |
| resource_managers::Profile * | player1, | ||
| bool | player1AutoPlay, | ||
| bool | player1Replay, | ||
| gameplay_logic::BmsScoreCourse * | score1, | ||
| resource_managers::Profile * | player2, | ||
| bool | player2AutoPlay, | ||
| bool | player2Replay, | ||
| gameplay_logic::BmsScoreCourse * | score2 | ||
| ) | const |
Loads a course with the given parameters.
| course | The course to load. |
| player1 | The first player profile. |
| player1AutoPlay | Whether the first player is in auto-play mode. |
| score1 | The score to replay for the first player, optional. Incompatible with auto-play. |
| player2 | The second player profile, can be nullptr for single-player. |
| player2AutoPlay | Whether the second player is in auto-play mode. |
| score2 | The score to replay for the second player. Incompatible with auto-play. |
| auto qml_components::ChartLoader::retryChart | ( | gameplay_logic::ChartRunner * | current, |
| bool | samePattern | ||
| ) | const |
Creates a new runner without stopping, finishing or saving current. Same-pattern retry preserves the chart's random branches and lane transformation. Otherwise the current profile options are used. Returns nullptr when unsupported or loading fails. The caller owns the new runner; Arena eligibility and screen navigation are caller policies.