Integrated noteCount, whereTheFeetAre, and columns into Row object (makes tech counts a little cleaner)

This commit is contained in:
Michael Votaw
2025-02-11 19:39:03 -08:00
committed by teejusb
parent 212b99a4c5
commit c7af0a4436
3 changed files with 28 additions and 9 deletions
+17
View File
@@ -169,6 +169,23 @@ float StageLayout::getPlayerAngle(StepParity::StagePoint left, StepParity::Stage
return atan2f(det, dot); return atan2f(det, dot);
} }
//
// Row
//
void Row::setFootPlacement(const std::vector<Foot> & footPlacement)
{
for (int c = 0; c < columnCount; c++) {
if(notes[c].type != TapNoteType_Empty) {
notes[c].parity = footPlacement[c];
columns[c] = footPlacement[c];
whereTheFeetAre[footPlacement[c]] = c;
noteCount += 1;
}
}
}
// //
// Json methods // Json methods
// //
+10 -4
View File
@@ -60,6 +60,8 @@ namespace StepParity {
"BRACKETJACK", "BRACKETJACK",
"JACK", "JACK",
"JUMP", "JUMP",
"SLOW_BRACKET",
"TWISTED_FOOT",
"BRACKETTAP", "BRACKETTAP",
"HOLDSWITCH", "HOLDSWITCH",
"MINE", "MINE",
@@ -198,11 +200,14 @@ namespace StepParity {
// preceding this one, the time of when that mine occurred, indexed by column. // preceding this one, the time of when that mine occurred, indexed by column.
std::vector<float> fakeMines; // The same thing, but for fake mines std::vector<float> fakeMines; // The same thing, but for fake mines
FootPlacement columns;
std::vector<int> whereTheFeetAre;
float second = 0; float second = 0;
float beat = 0; float beat = 0;
int rowIndex = 0; int rowIndex = 0;
int columnCount = 0; int columnCount = 0;
int noteCount = 0;
Row() Row()
{ {
Row(0); Row(0);
@@ -216,11 +221,12 @@ namespace StepParity {
holdTails.clear(); holdTails.clear();
mines = std::vector<float>(columnCount, 0); mines = std::vector<float>(columnCount, 0);
fakeMines = std::vector<float>(columnCount, 0); fakeMines = std::vector<float>(columnCount, 0);
second = 0; columns = std::vector<StepParity::Foot>(columnCount, StepParity::NONE);
beat = 0; whereTheFeetAre = std::vector<int>(StepParity::NUM_Foot, -1);
rowIndex = 0;
} }
void setFootPlacement(const std::vector<Foot> & footPlacement);
Json::Value ToJson(bool useStrings); Json::Value ToJson(bool useStrings);
static Json::Value ToJsonRows(const std::vector<Row> & rows, bool useStrings); static Json::Value ToJsonRows(const std::vector<Row> & rows, bool useStrings);
static Json::Value ParityRowsJson(const std::vector<Row> & rows); static Json::Value ParityRowsJson(const std::vector<Row> & rows);
+1 -5
View File
@@ -33,11 +33,7 @@ void StepParityGenerator::analyzeGraph() {
for (unsigned long i = 0; i < rows.size(); i++) for (unsigned long i = 0; i < rows.size(); i++)
{ {
StepParityNode *node = graph[nodes_for_rows[i]]; StepParityNode *node = graph[nodes_for_rows[i]];
for (int j = 0; j < rows[i].columnCount; j++) { rows[i].setFootPlacement(node->state.columns);
if(rows[i].notes[j].type != TapNoteType_Empty) {
rows[i].notes[j].parity = node->state.columns[j];
}
}
} }
} }