34 std::array<const Block *, 3> target{};
37 target = {grid->at(next_x, next_y), grid->at(next_x, next_y + 1), grid->at(next_x, next_y + 2)};
40 target = {grid->at(next_x, next_y), grid->at(next_x + 1, next_y), grid->at(next_x + 2, next_y)};
43 target = {grid->at(next_x, next_y), grid->at(next_x - 1, next_y), grid->at(next_x - 2, next_y)};
46 target = {grid->at(next_x, next_y), grid->at(next_x, next_y - 1), grid->at(next_x, next_y - 2)};
52 return std::all_of(target.begin(), target.end(), [](
const Block *block) {
53 return block != nullptr && block->color == 0;
94 std::array<Block *, 3> target{};
97 target = {grid->at(x, y), grid->at(x, y + 1), grid->at(x, y + 2)};
100 target = {grid->at(x, y), grid->at(x + 1, y), grid->at(x + 2, y)};
103 target = {grid->at(x, y), grid->at(x - 1, y), grid->at(x - 2, y)};
106 target = {grid->at(x, y), grid->at(x, y - 1), grid->at(x, y - 2)};
112 for (std::size_t i = 0; i < target.size(); ++i) {
113 if (target[i] ==
nullptr || target[i]->color != 0) {
116 target[i]->color = blocks[i].color;
117 target[i]->clearElapsedMs = 0;