diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index 0df310b..1104c63 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -333,6 +333,7 @@ bool GOLTeamH::setFromPattern(std::string const& pattern, int centerX, int cente return false; fillDataFromPattern(sq.value(), centerX + 1, centerY + 1); + setBorder(); mIteration = 0; countLifeStatusCells(); @@ -358,6 +359,7 @@ bool GOLTeamH::setFromPattern(std::string const& pattern) return false; fillDataFromPattern(sq.value(), (mData.width() / 2) + 1, (mData.height() / 2) + 1); + setBorder(); mIteration = 0; countLifeStatusCells(); @@ -561,7 +563,7 @@ std::optional GOLTeamH::parsePattern(std::string const& p void GOLTeamH::fillDataFromPattern(sizeQueried& sq, int centerX, int centerY) { - mData.fill(State::dead, false); + mData.fill(State::dead, true); // Remplissage de la grille aux positions spécifiées par le patron for (size_t y = 0; y < sq.height; ++y) {