27 lines
808 B
C++
27 lines
808 B
C++
#include "../../includes/Dames/PlateauDames.hpp"
|
|
#include "../../includes/Dames/PieceDames.hpp"
|
|
|
|
PlateauDames::PlateauDames(Joueur &joueur1, Joueur &joueur2)
|
|
: Plateau(10), j1(&joueur1), j2(&joueur2) {}
|
|
|
|
PlateauDames::~PlateauDames() {}
|
|
|
|
void PlateauDames::initialiserPlateau() {
|
|
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(PieceDames::Noire, i, j);
|
|
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(PieceDames::Blanche, i, j);
|
|
j2->ajoutPiece(plateau[i][j]);
|
|
}
|
|
}
|
|
}
|
|
}
|