21 inline auto GetBasicPath()
const ->
const std::string
23 return BASIC_REPLAY_DIR + scoreKey;
26 inline auto GetFullPath()
const ->
const std::string
28 return FULL_REPLAY_DIR + scoreKey;
31 inline auto GetInputPath()
const ->
const std::string
33 return INPUT_DATA_DIR + scoreKey;
36 inline auto GetOnlinePath()
const ->
const std::string
38 return ONLINE_DATA_DIR + scoreKey;
41 auto GetOffsetVector()
const ->
const std::vector<float>&
45 auto GetCopyOfOffsetVector()
const -> std::vector<float>
49 void SetOffsetVector(
const std::vector<float>& v) { vOffsetVector = v; }
51 auto GetNoteRowVector()
const ->
const std::vector<int>&
53 return vNoteRowVector;
55 auto GetCopyOfNoteRowVector()
const -> std::vector<int>
57 return vNoteRowVector;
59 void SetNoteRowVector(
const std::vector<int>& v) { vNoteRowVector = v; }
61 auto GetTrackVector()
const ->
const std::vector<int>&
65 auto GetCopyOfTrackVector()
const -> std::vector<int>
69 void SetTrackVector(
const std::vector<int>& v) { vTrackVector = v; }
71 auto GetTapNoteTypeVector()
const ->
const std::vector<TapNoteType>&
73 return vTapNoteTypeVector;
75 auto GetCopyOfTapNoteTypeVector()
const -> std::vector<TapNoteType>
77 return vTapNoteTypeVector;
79 void SetTapNoteTypeVector(
const std::vector<TapNoteType>& v)
81 vTapNoteTypeVector = v;
84 auto GetHoldReplayDataVector()
const ->
const std::vector<HoldReplayResult>&
86 return vHoldReplayDataVector;
88 auto GetCopyOfHoldReplayDataVector()
const -> std::vector<HoldReplayResult>
90 return vHoldReplayDataVector;
92 void SetHoldReplayDataVector(
const std::vector<HoldReplayResult>& v)
94 vHoldReplayDataVector = v;
97 auto GetMineReplayDataVector()
const ->
const std::vector<MineReplayResult>&
99 return vMineReplayDataVector;
101 auto GetCopyOfMineReplayDataVector()
const -> std::vector<MineReplayResult>
103 return vMineReplayDataVector;
105 void SetMineReplayDataVector(
const std::vector<MineReplayResult>& v)
107 vMineReplayDataVector = v;
110 auto GetOnlineReplayTimestampVector()
const ->
const std::vector<float>&
112 return vOnlineReplayTimestampVector;
114 auto GetCopyOfOnlineReplayTimestampVector()
const -> std::vector<float>
116 return vOnlineReplayTimestampVector;
118 void SetOnlineReplayTimestampVector(
const std::vector<float>& v)
120 vOnlineReplayTimestampVector = v;
123 auto GetInputDataVector()
const ->
const std::vector<InputDataEvent>&
127 auto GetCopyOfInputDataVector()
const -> std::vector<InputDataEvent>
131 void SetInputDataVector(
const std::vector<InputDataEvent>& v)
136 auto GetMissReplayDataVector()
const ->
const std::vector<MissReplayResult>&
138 return vMissReplayDataVector;
140 auto GetCopyOfMissReplayDataVector()
const -> std::vector<MissReplayResult>
142 return vMissReplayDataVector;
144 void SetMissReplayDataVector(
const std::vector<MissReplayResult>& v)
146 vMissReplayDataVector = v;
149 auto GetReplaySnapshotMap()
const ->
const std::map<int, ReplaySnapshot>&
151 return m_ReplaySnapshotMap;
153 auto GetCopyOfReplaySnapshotMap()
const -> std::map<int, ReplaySnapshot>
155 return m_ReplaySnapshotMap;
157 void SetReplaySnapshotMap(
const std::map<int, ReplaySnapshot>& m)
159 m_ReplaySnapshotMap = m;
162 auto GetJudgeInfo() ->
JudgeInfo& {
return judgeInfo; }
163 auto GetCopyOfJudgeInfo()
const ->
JudgeInfo {
return judgeInfo; }
164 void SetJudgeInfo(
const JudgeInfo& ji) { judgeInfo = ji; }
166 auto GetScoreKey()
const -> std::string {
return scoreKey; }
167 void SetScoreKey(std::string& key) { scoreKey = key; }
168 auto GetChartKey()
const -> std::string {
return chartKey; }
169 void SetChartKey(std::string& key) { chartKey = key; }
170 auto GetMusicRate()
const ->
float {
return fMusicRate; }
171 void SetMusicRate(
float f) { fMusicRate = f; }
172 auto GetSongOffset()
const ->
float {
return fSongOffset; }
173 void SetSongOffset(
float f) { fSongOffset = f; }
174 auto GetGlobalOffset()
const ->
float {
return fGlobalOffset; }
175 void SetGlobalOffset(
float f) { fGlobalOffset = f; }
176 auto GetRngSeed()
const ->
int {
return rngSeed; }
177 void SetRngSeed(
int seed) { rngSeed = seed; }
178 auto GetModifiers()
const -> std::string {
return mods; }
179 void SetModifiers(std::string& modstr) { mods = modstr; }
181 void SetUseReprioritizedNoteRows(
bool b)
183 if (b != useReprioritizedNoterows) {
184 if (IsOnlineScore()) {
185 if (vOnlineNoteRowVector.empty() &&
188 vOnlineOffsetVector = GetCopyOfOffsetVector();
189 vOnlineNoteRowVector = GetCopyOfNoteRowVector();
190 vOnlineTrackVector = GetCopyOfTrackVector();
191 vOnlineTapNoteTypeVector = GetCopyOfTapNoteTypeVector();
194 ClearPrimitiveVectors();
195 ClearReprioritizedVectors();
197 if (generatedInputData) {
199 vMissReplayDataVector.clear();
200 vHoldReplayDataVector.clear();
201 vMineReplayDataVector.clear();
202 generatedInputData =
false;
204 useReprioritizedNoterows = b;
206 auto UsingReprioritizedNoteRows() ->
bool
208 return useReprioritizedNoterows;
210 auto GetReprioritizedMissData()
const
211 ->
const std::vector<MissReplayResult>&
213 return vReprioritizedMissData;
215 auto GetCopyOfReprioritizedMissData()
const -> std::vector<MissReplayResult>
217 return vReprioritizedMissData;
219 void SetReprioritizedMissData(
const std::vector<MissReplayResult>& v) {
220 vReprioritizedMissData = v;
222 auto GetReprioritizedHoldData()
const
223 ->
const std::vector<HoldReplayResult>&
225 return vReprioritizedHoldData;
227 auto GetCopyOfReprioritizedHoldData()
const -> std::vector<HoldReplayResult>
229 return vReprioritizedHoldData;
231 void SetReprioritizedHoldData(
const std::vector<HoldReplayResult>& v)
233 vReprioritizedHoldData = v;
235 auto GetReprioritizedMineData()
const
236 ->
const std::vector<MineReplayResult>&
238 return vReprioritizedMineData;
240 auto GetCopyOfReprioritizedMineData()
const -> std::vector<MineReplayResult>
242 return vReprioritizedMineData;
244 void SetReprioritizedMineData(
const std::vector<MineReplayResult>& v)
246 vReprioritizedMineData = v;
249 auto GetRelevantMissData()
const ->
const std::vector<MissReplayResult>&
251 if (useReprioritizedNoterows) {
252 return vReprioritizedMissData;
254 return vMissReplayDataVector;
257 auto GetRelevantHoldData()
const ->
const std::vector<HoldReplayResult>& {
258 if (useReprioritizedNoterows) {
259 return vReprioritizedHoldData;
261 return vHoldReplayDataVector;
264 auto GetRelevantMineData()
const ->
const std::vector<MineReplayResult>& {
265 if (useReprioritizedNoterows) {
266 return vReprioritizedMineData;
268 return vMineReplayDataVector;
273 ReplayType GetReplayType()
const
275 if (!InputData.empty()) {
277 return ReplayType_Input;
278 }
else if (!vTrackVector.empty()) {
280 return ReplayType_V2;
281 }
else if (!vNoteRowVector.empty()) {
283 return ReplayType_V1;
286 return ReplayType_Invalid;
293 const auto t = GetReplayType();
294 return t >= ReplayType_V2 && t < NUM_ReplayType;
297 auto WriteReplayData() -> bool;
299 auto LoadReplayData() -> bool;
300 auto HasReplayData() -> bool;
301 auto HasWrittenReplayData() -> bool;
321 -> std::map<int, std::vector<PlaybackEvent>>;
325 float timingScale = 1.F) -> bool;
332 -> std::map<int, std::set<int>>;
336 -> std::map<int, std::set<int>>;
360 auto GetSteps() ->
Steps*;
361 auto GetNoteData(
Steps* pSteps =
nullptr,
bool bTransform =
true)
364 auto GetStyle() ->
const Style*;
366 auto GetReplaySnapshotForNoterow(
int row)
367 -> std::shared_ptr<ReplaySnapshot>;
372 bool IsOnlineScore()
const
374 return scoreKey.find(
"Online_") != std::string::npos;
379 useReprioritizedNoterows =
false;
380 generatedInputData =
false;
383 m_ReplaySnapshotMap.clear();
385 ClearReprioritizedVectors();
388 ClearPrimitiveVectors();
391 vMissReplayDataVector.clear();
392 vHoldReplayDataVector.clear();
393 vMineReplayDataVector.clear();
395 InputData.shrink_to_fit();
396 vMissReplayDataVector.shrink_to_fit();
397 vHoldReplayDataVector.shrink_to_fit();
398 vMineReplayDataVector.shrink_to_fit();
401 vOnlineOffsetVector.clear();
402 vOnlineNoteRowVector.clear();
403 vOnlineTrackVector.clear();
404 vOnlineTapNoteTypeVector.clear();
405 vOnlineOffsetVector.shrink_to_fit();
406 vOnlineNoteRowVector.shrink_to_fit();
407 vOnlineTrackVector.shrink_to_fit();
408 vOnlineTapNoteTypeVector.shrink_to_fit();
419 auto LoadReplayDataBasic(
const std::string& replayDir = BASIC_REPLAY_DIR)
421 auto LoadReplayDataFull(
const std::string& replayDir = FULL_REPLAY_DIR)
423 auto LoadInputData(
const std::string& replayDir = INPUT_DATA_DIR) -> bool;
424 auto LoadOnlineDataFromDisk(
const std::string& replayDir = ONLINE_DATA_DIR)
426 auto LoadStoredOnlineData() -> bool;
431 auto GenerateReplayV2DataPresumptively() -> bool;
433 void ClearPrimitiveVectors() {
434 vOffsetVector.clear();
435 vNoteRowVector.clear();
436 vTrackVector.clear();
437 vTapNoteTypeVector.clear();
438 vOnlineReplayTimestampVector.clear();
440 vOffsetVector.shrink_to_fit();
441 vNoteRowVector.shrink_to_fit();
442 vTrackVector.shrink_to_fit();
443 vTapNoteTypeVector.shrink_to_fit();
444 vOnlineReplayTimestampVector.shrink_to_fit();
447 void ClearReprioritizedVectors() {
448 vReprioritizedMissData.clear();
449 vReprioritizedHoldData.clear();
450 vReprioritizedMineData.clear();
451 vReprioritizedMissData.shrink_to_fit();
452 vReprioritizedHoldData.shrink_to_fit();
453 vReprioritizedMineData.shrink_to_fit();
456 std::map<int, ReplaySnapshot> m_ReplaySnapshotMap{};
461 std::set<int> significantNoterows{};
465 bool useReprioritizedNoterows =
false;
466 std::vector<MissReplayResult> vReprioritizedMissData{};
467 std::vector<MineReplayResult> vReprioritizedMineData{};
468 std::vector<HoldReplayResult> vReprioritizedHoldData{};
470 std::string scoreKey{};
471 std::string chartKey{};
472 float fMusicRate = 1.F;
473 float fSongOffset = 0.F;
474 float fGlobalOffset = 0.F;
478 std::vector<InputDataEvent> InputData{};
479 std::vector<MissReplayResult> vMissReplayDataVector{};
480 std::vector<float> vOffsetVector{};
481 std::vector<int> vNoteRowVector{};
482 std::vector<int> vTrackVector{};
483 std::vector<TapNoteType> vTapNoteTypeVector{};
484 std::vector<HoldReplayResult> vHoldReplayDataVector{};
485 std::vector<MineReplayResult> vMineReplayDataVector{};
486 std::vector<float> vOnlineReplayTimestampVector{};
494 bool generatedInputData =
false;
497 bool attemptedToLoadInputData =
false;
498 bool loadResultInputData =
false;
499 bool attemptedToLoadReplayV2 =
false;
500 bool loadResultReplayV2 =
false;
501 bool attemptedToLoadReplayV1 =
false;
502 bool loadResultReplayV1 =
false;
504 bool LoadedInputData(
bool b) {
505 attemptedToLoadInputData =
true;
506 loadResultInputData = b;
509 bool LoadedReplayV2(
bool b) {
510 attemptedToLoadReplayV2 =
true;
511 loadResultReplayV2 = b;
514 bool LoadedReplayV1(
bool b) {
515 attemptedToLoadReplayV1 =
true;
516 loadResultReplayV1 = b;
522 std::vector<float> vOnlineOffsetVector{};
523 std::vector<int> vOnlineNoteRowVector{};
524 std::vector<int> vOnlineTrackVector{};
525 std::vector<TapNoteType> vOnlineTapNoteTypeVector{};