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/Plateau.cpp

42 lines
826 B
C++
Raw Normal View History

#include "../includes/Plateau.hpp"
2023-11-21 18:07:13 +01:00
Plateau::Plateau(int t) {
2023-11-24 20:34:22 +01:00
// Création du plateau vide
2023-11-21 18:07:13 +01:00
plateau = new Piece **[t];
for (int i = 0; i < t; i++) {
plateau[i] = new Piece *[t];
for (int j = 0; j < t; j++) {
plateau[i][j] = nullptr;
}
}
}
2023-11-24 20:34:22 +01:00
Plateau::~Plateau() {
for (int i = 0; i < taille; i++) {
delete[] plateau[i];
}
delete[] plateau;
}
Plateau::Plateau(const Plateau &) {}
const Plateau &Plateau::operator=(const Plateau &src) {
if (this == &src) {
return *this;
}
return *this;
}
2023-11-24 20:14:05 +01:00
void Plateau::initialiserPlateau() {}
void Plateau::afficherPlateau() {}
void Plateau::modifierPlateau(int x, int y, Piece *piece) {
if (x >= 0 && x < taille && y >= 0 && y < taille) {
plateau[x][y] = piece;
} else {
throw std::invalid_argument("Coordonnées invalides");
}
}