diff --git a/includes/Dames/PieceDames.hpp b/includes/Dames/PieceDames.hpp index b670d83..466f94f 100644 --- a/includes/Dames/PieceDames.hpp +++ b/includes/Dames/PieceDames.hpp @@ -8,8 +8,6 @@ struct PieceDames : public Piece { Noire, }; - const enum Categorie _category; - PieceDames(const enum Categorie, const int x, const int y); virtual ~PieceDames(); @@ -26,6 +24,8 @@ struct PieceDames : public Piece { void setDame(const bool d); private: + const enum Categorie _category; + // True si la piece est une dame bool dame; diff --git a/includes/Safari/PieceSafari.hpp b/includes/Safari/PieceSafari.hpp index 22ef988..c09ae66 100644 --- a/includes/Safari/PieceSafari.hpp +++ b/includes/Safari/PieceSafari.hpp @@ -10,8 +10,6 @@ struct PieceSafari : public Piece { Lion, }; - const enum Categorie _category; - PieceSafari(const enum Categorie, const int x, const int y, const int pos2X = -1, const int pos2Y = -1); virtual ~PieceSafari(); @@ -29,6 +27,8 @@ struct PieceSafari : public Piece { Position getPos2() const; private: + const enum Categorie _category; + // Seconde position, utilisée par les barrières, qui se placent entre 2 pièces Position pos2; diff --git a/src/Dames/Dames.cpp b/src/Dames/Dames.cpp index 11a0990..d9bbd82 100644 --- a/src/Dames/Dames.cpp +++ b/src/Dames/Dames.cpp @@ -50,24 +50,21 @@ void Dames::event(const int x, const int y) { std::cout << "Clic souris @ (" << x << ", " << y << ") aka (" << posCurseur.first << ", " << posCurseur.second << ")\n"; - switch(etape){ - case ChoixJ1: { - - } - case ChoixJ2: { - - } - case EnJeu: { - const Piece *p = getPiece(posCurseur.first, posCurseur.second); - /*if (getPiece(posCurseur.first, posCurseur.second)->getCategory() == - getPiece(joueurCourant->getPieces().at(0))->getCategory()) { - // On sélectionne la pièce - plateau.modifierSelection(posCurseur.first, posCurseur.second); - }*/ - } - case Fini: { - - } + switch (etape) { + case ChoixJ1: { + } + case ChoixJ2: { + } + case EnJeu: { + const Piece *p = getPiece(posCurseur.first, posCurseur.second); + /*if (getPiece(posCurseur.first, posCurseur.second)->getCategory() == + getPiece(joueurCourant->getPieces().at(0))->getCategory()) { + // On sélectionne la pièce + plateau.modifierSelection(posCurseur.first, posCurseur.second); + }*/ + } + case Fini: { + } } } diff --git a/src/Dames/PieceDames.cpp b/src/Dames/PieceDames.cpp index 2a04748..e8da780 100644 --- a/src/Dames/PieceDames.cpp +++ b/src/Dames/PieceDames.cpp @@ -1,7 +1,7 @@ #include "../../includes/Dames/PieceDames.hpp" PieceDames::PieceDames(const enum Categorie cat, const int posX, const int posY) - : Piece(to_string(cat), posX, posY), dame(false) { + : Piece(to_string(cat), posX, posY), _category(cat), dame(false) { std::cout << "pièce - " << categorie << "\n"; } diff --git a/src/Dames/PlateauDames.cpp b/src/Dames/PlateauDames.cpp index ea607b4..018227d 100644 --- a/src/Dames/PlateauDames.cpp +++ b/src/Dames/PlateauDames.cpp @@ -24,14 +24,13 @@ PlateauDames::PlateauDames(Joueur &joueur1, Joueur &joueur2) PlateauDames::~PlateauDames() {} - // Peut-etre utiliser cette fonction pour prisePossible ? bool PlateauDames::deplacementValide(const int x, const int y) const { if (!selection) { return false; } + // TODO Position posInitiale = selection->getPos(); - - + return false; }