Mylloon
bf74632047
* add const identifiers * expose category for children * documentation * helper for ignoring arguments * reduce useless imports * use enum for categories * refactor Dames instanciation
26 lines
752 B
C++
26 lines
752 B
C++
#include "../../includes/Dames/PlateauDames.hpp"
|
|
#include "../../includes/Dames/PieceDames.hpp"
|
|
|
|
PlateauDames::PlateauDames() : Plateau(10) {}
|
|
|
|
PlateauDames::~PlateauDames() {}
|
|
|
|
void PlateauDames::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(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(PieceDames::Blanche);
|
|
j2.ajoutPiece(plateau[i][j]);
|
|
}
|
|
}
|
|
}
|
|
}
|