Skip to content

Commit f63ea82

Browse files
committed
Specify and document new PlayerAI functions
1 parent 2003f69 commit f63ea82

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/PlayerAI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS];
5252
HighScore* PlayerAI::pScoreData = nullptr;
5353
map<int, vector<TapReplayResult>> PlayerAI::m_ReplayTapMap;
5454
map<int, vector<HoldReplayResult>> PlayerAI::m_ReplayHoldMap;
55+
map<int, vector<TapReplayResult>> PlayerAI::m_ReplayExactTapMap;
5556

5657
void
5758
PlayerAI::InitFromDisk()
@@ -157,6 +158,8 @@ PlayerAI::SetScoreData(HighScore* pHighScore)
157158
pScoreData = pHighScore;
158159
m_ReplayTapMap.clear();
159160
m_ReplayHoldMap.clear();
161+
m_ReplayExactTapMap.clear();
162+
160163
auto replayNoteRowVector = pHighScore->GetCopyOfNoteRowVector();
161164
auto replayOffsetVector = pHighScore->GetCopyOfOffsetVector();
162165
auto replayTapNoteTypeVector = pHighScore->GetCopyOfTapNoteTypeVector();

src/PlayerAI.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class PlayerAI
2525
// A map with indices for each row of the chart, pointing to nothing or hold
2626
// drop results.
2727
static map<int, vector<HoldReplayResult>> m_ReplayHoldMap;
28+
// A map with indices for each row of the chart, pointing to nothing or a
29+
// Normal Result. However, note that the rows within are actually calculated
30+
// so that they are adjusted for offsets relative to the actual replay data/notedata.
31+
// This map is only useful for charts with column data.
32+
static map<int, vector<TapReplayResult>> m_ReplayExactTapMap;
2833

2934
static void InitFromDisk();
3035
static TapNoteScore GetTapNoteScore(const PlayerState* pPlayerState);
@@ -35,6 +40,27 @@ class PlayerAI
3540
const PlayerState* pPlayerState,
3641
float fNoteOffset);
3742
static bool DetermineIfHoldDropped(int noteRow, int col);
43+
// Returns the column that needs to be tapped.
44+
// Returns -1 if no column needs to be tapped.
45+
static int DetermineNextTapColumn(int noteRow, int searchRowDistance, TimingData* timing);
46+
// Literally get the next row in the replay data. Disregard offset calculations.
47+
static int GetNextRowNoOffsets(int currentRow);
48+
// Reset and populate the ReplayExactTapMap.
49+
// This is meant to be run once Gameplay begins.
50+
static void SetUpExactTapMap(TimingData* timing);
51+
// Check the Tap Replay Data to see if a tap is on this row
52+
static bool TapExistsAtThisRow(int noteRow);
53+
static bool TapExistsAtOrBeforeThisRow(int noteRow);
54+
// Build a list of columns/tracks to tap based on the given noterow.
55+
static vector<TapReplayResult> GetTapsToTapForRow(int noteRow);
56+
static int GetReplayType();
57+
// Build a list of columns/tracks that happened at or before the given noterow.
58+
// (if we lag and somehow skip rows)
59+
static vector<TapReplayResult> GetTapsAtOrBeforeRow(int noteRow);
60+
// Given a column and row, retrieve the adjusted row.
61+
static int GetAdjustedRowFromUnadjustedCoordinates(int row, int col);
62+
// Remove a given Tap from the fallback and Full replay data vectors
63+
static void RemoveTapFromVectors(int row, int col);
3864
};
3965

4066
#endif

0 commit comments

Comments
 (0)