32 std::array<const Block *, 3> target{};
35 target = {grid->at(next_x, next_y), grid->at(next_x, next_y + 1), grid->at(next_x, next_y + 2)};
38 target = {grid->at(next_x, next_y), grid->at(next_x + 1, next_y), grid->at(next_x + 2, next_y)};
41 target = {grid->at(next_x, next_y), grid->at(next_x - 1, next_y), grid->at(next_x - 2, next_y)};
44 target = {grid->at(next_x, next_y), grid->at(next_x, next_y - 1), grid->at(next_x, next_y - 2)};
50 return std::all_of(target.begin(), target.end(), [](
const Block *block) { return block != nullptr && block->color == 0; });
90 std::array<Block *, 3> target{};
93 target = {grid->at(x, y), grid->at(x, y + 1), grid->at(x, y + 2)};
96 target = {grid->at(x, y), grid->at(x + 1, y), grid->at(x + 2, y)};
99 target = {grid->at(x, y), grid->at(x - 1, y), grid->at(x - 2, y)};
102 target = {grid->at(x, y), grid->at(x, y - 1), grid->at(x, y - 2)};
108 for (std::size_t i = 0; i < target.size(); ++i) {
109 if (target[i] ==
nullptr || target[i]->color != 0) {
112 target[i]->color = blocks[i].color;
113 target[i]->clearElapsedMs = 0;