This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
DamesEtCo/src/Dames/PlateauDames.cpp

26 lines
764 B
C++
Raw Normal View History

2023-12-14 15:58:43 +01:00
#include "../../includes/Dames/PlateauDames.hpp"
#include "../../includes/Dames/PieceDames.hpp"
PlateauDames::PlateauDames(Joueur &joueur1, Joueur &joueur2)
2024-01-07 12:51:04 +01:00
: Plateau(10), j1(&joueur1), j2(&joueur2) {
2023-12-14 15:58:43 +01:00
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)) {
2023-12-29 02:09:11 +01:00
plateau[i][j] = new PieceDames(PieceDames::Noire, i, j);
j1->ajoutPiece(plateau[i][j]);
2023-12-14 15:58:43 +01:00
}
}
}
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)) {
2023-12-29 02:09:11 +01:00
plateau[i][j] = new PieceDames(PieceDames::Blanche, i, j);
j2->ajoutPiece(plateau[i][j]);
2023-12-14 15:58:43 +01:00
}
}
}
}
2024-01-07 12:51:04 +01:00
PlateauDames::~PlateauDames() {}