Etterna 0.74.4
Loading...
Searching...
No Matches
Difficulty.h
1#ifndef DIFFICULTY_H
2#define DIFFICULTY_H
3
4#include "EnumHelper.h"
5#include "GameConstantsAndTypes.h"
6
7class Song;
8class Steps;
9
10// Player number stuff
11enum Difficulty
12{
13 Difficulty_Beginner,
14 Difficulty_Easy,
15 Difficulty_Medium,
16 Difficulty_Hard,
17 Difficulty_Challenge,
18 Difficulty_Edit,
19 NUM_Difficulty,
20 Difficulty_Invalid
21};
22auto
23DifficultyToString(Difficulty dc) -> const std::string&;
24auto
25StringToDifficulty(const std::string& sDC) -> Difficulty;
26LuaDeclareType(Difficulty);
27
28auto
29OldStyleStringToDifficulty(const std::string& sDC)
30 -> Difficulty; // compatibility
31
32// CustomDifficulty is a themeable difficulty name based on Difficulty, string
33// matching on StepsType, and CourseType. It is used to look up localized
34// strings and look up colors.
35auto
36GetCustomDifficulty(StepsType st, Difficulty dc) -> std::string;
37auto
38CustomDifficultyToLocalizedString(const std::string& sCustomDifficulty)
39 -> std::string;
40auto
41StepsToCustomDifficulty(const Steps* pSteps) -> std::string;
42
43struct Chart
44{
45 std::string key;
46 std::string lastsong;
47 std::string lastpack;
48 Difficulty lastdiff = Difficulty_Invalid;
49 float rate = 1.F;
50 Song* songptr{};
51 Steps* stepsptr{};
52
53 auto IsLoaded() -> bool { return loaded; }
54
55 bool loaded = false;
56 void FromKey(const std::string& ck);
57 [[nodiscard]] auto CreateNode(bool includerate) const -> XNode*;
58 void LoadFromNode(const XNode* node);
59 void PushSelf(lua_State* L);
60};
61
63{
64 std::string name{};
65 std::vector<Chart> chartlist{};
66 int onlineId = 0;
67 void Add(const Chart& ch) { chartlist.emplace_back(ch); }
68 void AddChart(const std::string& ck);
69 void SwapPosition();
70
71 std::vector<std::vector<std::string>> courseruns;
72
73 [[nodiscard]] auto CreateNode() const -> XNode*;
74 void LoadFromNode(const XNode* node);
75 auto GetNumCharts() -> size_t { return chartlist.size(); }
76 auto GetKeys() -> std::vector<std::string>;
77 auto GetName() -> std::string { return name; }
78 auto GetAverageRating() -> float;
79 void DeleteChart(int i);
80 void UploadOnline();
81 void DownloadOnline();
82
83 void PushSelf(lua_State* L);
84};
85
87{
88 std::string ck;
89 float ev;
90 float rate;
91 std::map<int, float> version_history;
92};
93
95{
96 Skillset skillset;
97 std::map<std::string, CalcTest> filemapping;
98 [[nodiscard]] auto CreateNode() const -> XNode*;
99};
100
101#endif
Holds all music metadata and steps for one song.
Definition Song.h:65
Holds note information for a Song.
Definition Steps.h:42
Definition XmlFile.h:95
Definition Difficulty.h:95
Definition Difficulty.h:87
Definition Difficulty.h:44
Definition Difficulty.h:63