std::vector> get_successors() const override { std::vector> r; std::vector possibilities = { move_direction::UP, move_direction::DOWN, move_direction::LEFT, move_direction::RIGHT, }; for (move_direction n : possibilities) { auto state_copy = clone(); if(!dynamic_cast(*state_copy).make_move(n)) continue; state_copy->update_score(state_copy->get_g() + 1); state_copy->set_parent(this); r.push_back(std::move(state_copy)); } return r; }