diff --git a/src/StepParityDatastructs.cpp b/src/StepParityDatastructs.cpp index 976b90c917..5e917e62ad 100644 --- a/src/StepParityDatastructs.cpp +++ b/src/StepParityDatastructs.cpp @@ -169,6 +169,23 @@ float StageLayout::getPlayerAngle(StepParity::StagePoint left, StepParity::Stage return atan2f(det, dot); } +// +// Row +// + +void Row::setFootPlacement(const std::vector & 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 // diff --git a/src/StepParityDatastructs.h b/src/StepParityDatastructs.h index 8442b37f61..3959928eeb 100644 --- a/src/StepParityDatastructs.h +++ b/src/StepParityDatastructs.h @@ -60,6 +60,8 @@ namespace StepParity { "BRACKETJACK", "JACK", "JUMP", + "SLOW_BRACKET", + "TWISTED_FOOT", "BRACKETTAP", "HOLDSWITCH", "MINE", @@ -198,11 +200,14 @@ namespace StepParity { // preceding this one, the time of when that mine occurred, indexed by column. std::vector fakeMines; // The same thing, but for fake mines + FootPlacement columns; + std::vector whereTheFeetAre; + float second = 0; float beat = 0; int rowIndex = 0; int columnCount = 0; - + int noteCount = 0; Row() { Row(0); @@ -216,10 +221,11 @@ namespace StepParity { holdTails.clear(); mines = std::vector(columnCount, 0); fakeMines = std::vector(columnCount, 0); - second = 0; - beat = 0; - rowIndex = 0; + columns = std::vector(columnCount, StepParity::NONE); + whereTheFeetAre = std::vector(StepParity::NUM_Foot, -1); } + + void setFootPlacement(const std::vector & footPlacement); Json::Value ToJson(bool useStrings); static Json::Value ToJsonRows(const std::vector & rows, bool useStrings); diff --git a/src/StepParityGenerator.cpp b/src/StepParityGenerator.cpp index 1e7604ec09..b1968d19c5 100644 --- a/src/StepParityGenerator.cpp +++ b/src/StepParityGenerator.cpp @@ -33,11 +33,7 @@ void StepParityGenerator::analyzeGraph() { for (unsigned long i = 0; i < rows.size(); i++) { StepParityNode *node = graph[nodes_for_rows[i]]; - for (int j = 0; j < rows[i].columnCount; j++) { - if(rows[i].notes[j].type != TapNoteType_Empty) { - rows[i].notes[j].parity = node->state.columns[j]; - } - } + rows[i].setFootPlacement(node->state.columns); } }