aaaaaaaaaaaaaaaaaa

This commit is contained in:
Mylloon 2024-01-08 03:07:42 +01:00
parent 9d0b13fa9b
commit f298f9c8b8
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 3 additions and 12 deletions

View file

@ -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;

View file

@ -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 {