Commit c3d60926 authored by Frederik Schwarzer's avatar Frederik Schwarzer

Add explanation to possibly confusing code.

parent 2bedc382
......@@ -222,6 +222,10 @@ void Board::applyGravity(TilePos const tilePos1, TilePos const tilePos2)
if (!m_gravityFlag) {
return;
}
// If both removed tiles are in the same column, we iterate over the same
// column twice but all ideas I had to prevent that from happening seemed
// more complex that living with that second iteration once in a while.
// Maybe later ... (schwarzer)
std::array<int, 2> const affectedColumns = {tilePos1.x(), tilePos2.x()};
for (auto const column: affectedColumns) {
int rptr = yTiles() - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment