19 Replay(std::string chartKey,
26 inline const std::string GetBasicPath()
const
28 return BASIC_REPLAY_DIR + scoreKey;
31 inline const std::string GetFullPath()
const
33 return FULL_REPLAY_DIR + scoreKey;
36 inline const std::string GetInputPath()
const
38 return INPUT_DATA_DIR + scoreKey;
41 inline const std::string GetOnlinePath()
const
43 return ONLINE_DATA_DIR + scoreKey;
46 const std::vector<float>& GetOffsetVector()
const
50 std::vector<float> GetCopyOfOffsetVector()
const
54 void SetOffsetVector(
const std::vector<float>& v) { vOffsetVector = v; }
56 const std::vector<int>& GetNoteRowVector()
const
58 return vNoteRowVector;
60 std::vector<int> GetCopyOfNoteRowVector()
const
62 return vNoteRowVector;
64 void SetNoteRowVector(
const std::vector<int>& v) { vNoteRowVector = v; }
66 const std::vector<int>& GetTrackVector()
const
70 std::vector<int> GetCopyOfTrackVector()
const
74 void SetTrackVector(
const std::vector<int>& v) { vTrackVector = v; }
76 const std::vector<TapNoteType>& GetTapNoteTypeVector()
const
78 return vTapNoteTypeVector;
80 std::vector<TapNoteType> GetCopyOfTapNoteTypeVector()
const
82 return vTapNoteTypeVector;
84 void SetTapNoteTypeVector(
const std::vector<TapNoteType>& v)
86 vTapNoteTypeVector = v;
89 const std::vector<HoldReplayResult>& GetHoldReplayDataVector()
const
91 return vHoldReplayDataVector;
93 std::vector<HoldReplayResult> GetCopyOfHoldReplayDataVector()
const
95 return vHoldReplayDataVector;
97 void SetHoldReplayDataVector(
const std::vector<HoldReplayResult>& v)
99 vHoldReplayDataVector = v;
102 const std::vector<MineReplayResult>& GetMineReplayDataVector()
const
104 return vMineReplayDataVector;
106 std::vector<MineReplayResult> GetCopyOfMineReplayDataVector()
const
108 return vMineReplayDataVector;
110 void SetMineReplayDataVector(
const std::vector<MineReplayResult>& v)
112 vMineReplayDataVector = v;
115 const std::vector<float>& GetOnlineReplayTimestampVector()
const
117 return vOnlineReplayTimestampVector;
119 std::vector<float> GetCopyOfOnlineReplayTimestampVector()
const
121 return vOnlineReplayTimestampVector;
123 void SetOnlineReplayTimestampVector(
const std::vector<float>& v)
125 vOnlineReplayTimestampVector = v;
128 const std::vector<InputDataEvent>& GetInputDataVector()
const
132 std::vector<InputDataEvent> GetCopyOfInputDataVector()
const
136 void SetInputDataVector(
const std::vector<InputDataEvent>& v)
141 const std::vector<MissReplayResult>& GetMissReplayDataVector()
const
143 return vMissReplayDataVector;
145 std::vector<MissReplayResult> GetCopyOfMissReplayDataVector()
const
147 return vMissReplayDataVector;
149 void SetMissReplayDataVector(
const std::vector<MissReplayResult>& v)
151 vMissReplayDataVector = v;
154 const std::map<int, ReplaySnapshot>& GetReplaySnapshotMap()
const
156 return m_ReplaySnapshotMap;
158 std::map<int, ReplaySnapshot> GetCopyOfReplaySnapshotMap()
const
160 return m_ReplaySnapshotMap;
162 void SetReplaySnapshotMap(
const std::map<int, ReplaySnapshot>& m)
164 m_ReplaySnapshotMap = m;
167 JudgeInfo& GetJudgeInfo() {
return judgeInfo; }
168 JudgeInfo GetCopyOfJudgeInfo()
const {
return judgeInfo; }
169 void SetJudgeInfo(
const JudgeInfo& ji) { judgeInfo = ji; }
171 std::string GetScoreKey()
const {
return scoreKey; }
172 void SetScoreKey(std::string& key) { scoreKey = key; }
173 std::string GetChartKey()
const {
return chartKey; }
174 void SetChartKey(std::string& key) { chartKey = key; }
175 float GetMusicRate()
const {
return fMusicRate; }
176 void SetMusicRate(
float f) { fMusicRate = f; }
177 float GetSongOffset()
const {
return fSongOffset; }
178 void SetSongOffset(
float f) { fSongOffset = f; }
179 float GetGlobalOffset()
const {
return fGlobalOffset; }
180 void SetGlobalOffset(
float f) { fGlobalOffset = f; }
181 int GetRngSeed()
const {
return rngSeed; }
182 void SetRngSeed(
int seed) { rngSeed = seed; }
183 std::string GetModifiers()
const {
return mods; }
184 void SetModifiers(std::string& modstr) { mods = modstr; }
186 void SetUseReprioritizedNoteRows(
bool b)
188 if (b != useReprioritizedNoterows) {
189 if (IsOnlineScore()) {
190 if (vOnlineNoteRowVector.empty() &&
193 vOnlineOffsetVector = GetCopyOfOffsetVector();
194 vOnlineNoteRowVector = GetCopyOfNoteRowVector();
195 vOnlineTrackVector = GetCopyOfTrackVector();
196 vOnlineTapNoteTypeVector = GetCopyOfTapNoteTypeVector();
199 ClearPrimitiveVectors();
200 ClearReprioritizedVectors();
202 if (generatedInputData) {
204 vMissReplayDataVector.clear();
205 vHoldReplayDataVector.clear();
206 vMineReplayDataVector.clear();
207 generatedInputData =
false;
209 useReprioritizedNoterows = b;
211 bool UsingReprioritizedNoteRows()
213 return useReprioritizedNoterows;
215 const std::vector<MissReplayResult>& GetReprioritizedMissData()
const
217 return vReprioritizedMissData;
219 std::vector<MissReplayResult> GetCopyOfReprioritizedMissData()
const
221 return vReprioritizedMissData;
223 void SetReprioritizedMissData(
const std::vector<MissReplayResult>& v) {
224 vReprioritizedMissData = v;
226 const std::vector<HoldReplayResult>& GetReprioritizedHoldData()
const
228 return vReprioritizedHoldData;
230 std::vector<HoldReplayResult> GetCopyOfReprioritizedHoldData()
const
232 return vReprioritizedHoldData;
234 void SetReprioritizedHoldData(
const std::vector<HoldReplayResult>& v)
236 vReprioritizedHoldData = v;
238 const std::vector<MineReplayResult>& GetReprioritizedMineData()
const
240 return vReprioritizedMineData;
242 std::vector<MineReplayResult> GetCopyOfReprioritizedMineData()
const
244 return vReprioritizedMineData;
246 void SetReprioritizedMineData(
const std::vector<MineReplayResult>& v)
248 vReprioritizedMineData = v;
251 const std::vector<MissReplayResult>& GetRelevantMissData()
const
253 if (useReprioritizedNoterows) {
254 return vReprioritizedMissData;
256 return vMissReplayDataVector;
259 const std::vector<HoldReplayResult>& GetRelevantHoldData()
const
261 if (useReprioritizedNoterows) {
262 return vReprioritizedHoldData;
264 return vHoldReplayDataVector;
267 const std::vector<MineReplayResult>& GetRelevantMineData()
const
269 if (useReprioritizedNoterows) {
270 return vReprioritizedMineData;
272 return vMineReplayDataVector;
276 void IngestInputData(
bool ispress,
284 InputData.emplace_back(
285 ispress, col, musicsecs, row, -offset, tnt, tnst);
288 void IngestHoldDrop(
int col,
int row, TapNoteSubType tnst)
294 vHoldReplayDataVector.push_back(hrr);
297 void IngestMineHit(
int col,
int row)
302 vMineReplayDataVector.push_back(mrr);
305 void IngestMissData(
int col,
int row, TapNoteType tnt, TapNoteSubType tnst)
310 mrr.tapNoteType = tnt;
311 mrr.tapNoteSubType = tnst;
312 vMissReplayDataVector.push_back(mrr);
315 void IngestV2Data(
int col,
int row,
float offset, TapNoteType tnt)
317 vTrackVector.push_back(col);
318 vNoteRowVector.push_back(row);
319 vOffsetVector.push_back(offset);
320 vTapNoteTypeVector.push_back(tnt);
323 ReplayType GetReplayType()
const
325 if (!InputData.empty()) {
327 return ReplayType_Input;
328 }
else if (!vTrackVector.empty()) {
330 return ReplayType_V2;
331 }
else if (!vNoteRowVector.empty()) {
333 return ReplayType_V1;
336 return ReplayType_Invalid;
343 const auto t = GetReplayType();
344 return t >= ReplayType_V2 && t < NUM_ReplayType;
347 bool WriteReplayData();
349 bool LoadReplayData();
350 bool HasReplayData()
const;
351 bool HasWrittenReplayData()
const;
374 std::map<int, std::vector<PlaybackEvent>>
379 float timingScale = 1.F);
417 Steps* GetSteps()
const;
418 NoteData GetNoteData(
Steps* pSteps =
nullptr,
bool bTransform =
true);
420 const Style* GetStyle()
const;
422 std::shared_ptr<ReplaySnapshot> GetReplaySnapshotForNoterow(
int row);
427 bool IsOnlineScore()
const
429 return scoreKey.find(
"Online_") != std::string::npos;
432 bool IsSpectateScore()
const
434 return scoreKey.find(
"SPECTATE") != std::string::npos;
439 useReprioritizedNoterows =
false;
440 generatedInputData =
false;
443 m_ReplaySnapshotMap.clear();
445 ClearReprioritizedVectors();
448 ClearPrimitiveVectors();
451 vMissReplayDataVector.clear();
452 vHoldReplayDataVector.clear();
453 vMineReplayDataVector.clear();
455 InputData.shrink_to_fit();
456 vMissReplayDataVector.shrink_to_fit();
457 vHoldReplayDataVector.shrink_to_fit();
458 vMineReplayDataVector.shrink_to_fit();
461 vOnlineOffsetVector.clear();
462 vOnlineNoteRowVector.clear();
463 vOnlineTrackVector.clear();
464 vOnlineTapNoteTypeVector.clear();
465 vOnlineOffsetVector.shrink_to_fit();
466 vOnlineNoteRowVector.shrink_to_fit();
467 vOnlineTrackVector.shrink_to_fit();
468 vOnlineTapNoteTypeVector.shrink_to_fit();
479 bool LoadReplayDataBasic(
const std::string& replayDir = BASIC_REPLAY_DIR);
480 bool LoadReplayDataFull(
const std::string& replayDir = FULL_REPLAY_DIR);
481 bool LoadInputData(
const std::string& replayDir = INPUT_DATA_DIR);
482 bool LoadOnlineDataFromDisk(
const std::string& replayDir = ONLINE_DATA_DIR);
483 bool LoadStoredOnlineData();
488 bool GenerateReplayV2DataPresumptively();
490 void ClearPrimitiveVectors() {
491 vOffsetVector.clear();
492 vNoteRowVector.clear();
493 vTrackVector.clear();
494 vTapNoteTypeVector.clear();
495 vOnlineReplayTimestampVector.clear();
497 vOffsetVector.shrink_to_fit();
498 vNoteRowVector.shrink_to_fit();
499 vTrackVector.shrink_to_fit();
500 vTapNoteTypeVector.shrink_to_fit();
501 vOnlineReplayTimestampVector.shrink_to_fit();
504 void ClearReprioritizedVectors() {
505 vReprioritizedMissData.clear();
506 vReprioritizedHoldData.clear();
507 vReprioritizedMineData.clear();
508 vReprioritizedMissData.shrink_to_fit();
509 vReprioritizedHoldData.shrink_to_fit();
510 vReprioritizedMineData.shrink_to_fit();
513 std::map<int, ReplaySnapshot> m_ReplaySnapshotMap{};
518 std::set<int> significantNoterows{};
522 bool useReprioritizedNoterows =
false;
523 std::vector<MissReplayResult> vReprioritizedMissData{};
524 std::vector<MineReplayResult> vReprioritizedMineData{};
525 std::vector<HoldReplayResult> vReprioritizedHoldData{};
527 std::string scoreKey{};
528 std::string chartKey{};
529 float fMusicRate = 1.F;
530 float fSongOffset = 0.F;
531 float fGlobalOffset = 0.F;
535 std::vector<InputDataEvent> InputData{};
536 std::vector<MissReplayResult> vMissReplayDataVector{};
537 std::vector<float> vOffsetVector{};
538 std::vector<int> vNoteRowVector{};
539 std::vector<int> vTrackVector{};
540 std::vector<TapNoteType> vTapNoteTypeVector{};
541 std::vector<HoldReplayResult> vHoldReplayDataVector{};
542 std::vector<MineReplayResult> vMineReplayDataVector{};
543 std::vector<float> vOnlineReplayTimestampVector{};
551 bool generatedInputData =
false;
554 bool attemptedToLoadInputData =
false;
555 bool loadResultInputData =
false;
556 bool attemptedToLoadReplayV2 =
false;
557 bool loadResultReplayV2 =
false;
558 bool attemptedToLoadReplayV1 =
false;
559 bool loadResultReplayV1 =
false;
561 bool LoadedInputData(
bool b) {
562 attemptedToLoadInputData =
true;
563 loadResultInputData = b;
566 bool LoadedReplayV2(
bool b) {
567 attemptedToLoadReplayV2 =
true;
568 loadResultReplayV2 = b;
571 bool LoadedReplayV1(
bool b) {
572 attemptedToLoadReplayV1 =
true;
573 loadResultReplayV1 = b;
579 std::vector<float> vOnlineOffsetVector{};
580 std::vector<int> vOnlineNoteRowVector{};
581 std::vector<int> vOnlineTrackVector{};
582 std::vector<TapNoteType> vOnlineTapNoteTypeVector{};