From f298f9c8b888efcfc39a0ce38fd7458e6674c948 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 8 Jan 2024 03:07:42 +0100 Subject: [PATCH] aaaaaaaaaaaaaaaaaa --- includes/Safari/PlateauSafari.hpp | 2 +- src/Safari/PlateauSafari.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/includes/Safari/PlateauSafari.hpp b/includes/Safari/PlateauSafari.hpp index aae3e8d..06d82b9 100644 --- a/includes/Safari/PlateauSafari.hpp +++ b/includes/Safari/PlateauSafari.hpp @@ -12,7 +12,7 @@ struct PlateauSafari : public Plateau { // Pareil que deplacementValide mais est utilisable avec des coordonnées bool deplacementValideCoor(const int x1, const int y1, const int x2, - const int y2, const bool debug = false) const; + const int y2) const; // Vérifie que le déplacement est valide bool deplacementValide(const int destX, const int destY) const; diff --git a/src/Safari/PlateauSafari.cpp b/src/Safari/PlateauSafari.cpp index a032d5e..742fc9f 100644 --- a/src/Safari/PlateauSafari.cpp +++ b/src/Safari/PlateauSafari.cpp @@ -149,8 +149,7 @@ void PlateauSafari::afficherPlateau(std::ostream &out, const bool d) const { } bool PlateauSafari::deplacementValideCoor(const int x1, const int y1, - const int x2, const int y2, - const bool d) const { + const int x2, const int y2) const { // Vérifier qu'il n'y a pas de barrière sur le chemin for (PieceSafari *barriere : barrieres) { Position pos1 = barriere->getPos(); @@ -200,13 +199,6 @@ bool PlateauSafari::deplacementValideCoor(const int x1, const int y1, y1 > std::min(pos1.second, pos2.second) && y2 <= std::min(pos1.second, pos2.second); - if (d) { // debug - std::cout << std::boolalpha << "barriere " << pos1.first << "," - << pos1.second << " | " << pos2.first << "," << pos2.second - << " et pieces " << x1 << "," << y1 << " | " << x2 << "," << y2 - << " => " << gvd << " " << dvg << " " << hvb << " " << bvh - << std::endl; - } if (gvd || dvg || hvb || bvh) { return false; } @@ -222,8 +214,7 @@ bool PlateauSafari::deplacementValide(const int x, const int y) const { Position posInitiale = selection->getPos(); - return deplacementValideCoor(posInitiale.first, posInitiale.second, x, y, - true); + return deplacementValideCoor(posInitiale.first, posInitiale.second, x, y); } Position PlateauSafari::getPlaceholderBarriere() const {