diff --git a/src/Dames.cpp b/src/Dames.cpp index d19770e..a62a6ab 100644 --- a/src/Dames.cpp +++ b/src/Dames.cpp @@ -1,6 +1,8 @@ #include "../includes/Dames.hpp" Dames::Dames(Joueur &j1, Joueur & j2) : joueur1{j1}, joueur2{j2}, joueurCourrant{j1} { + Plateau p(10); + this->plateau = p; plateau.initialiserPlateau(j1, j2); } diff --git a/src/Plateau.cpp b/src/Plateau.cpp index cbe891e..668e984 100644 --- a/src/Plateau.cpp +++ b/src/Plateau.cpp @@ -31,7 +31,22 @@ const Plateau &Plateau::operator=(const Plateau &src) { } void Plateau::initialiserPlateau(Joueur &j1, Joueur &j2) { - + for(int i=0; i<4;i++){ + for(int j=0; j<10;j++){ + if((i%2==0 && j%2==1) || (i%2==1 && j%2==0)){ + plateau[i][j] = new PieceDames("noire"); + j1.ajoutPiece(plateau[i][j]); + } + } + } + for(int i=6; i<10;i++){ + for(int j=0; j<10;j++){ + if((i%2==0 && j%2==1) || (i%2==1 && j%2==0)){ + plateau[i][j] = new PieceDames("blanche"); + j2.ajoutPiece(plateau[i][j]); + } + } + } } void Plateau::afficherPlateau() {}