diff --git a/includes/Plateau.hpp b/includes/Plateau.hpp index 91bab05..4eadbc0 100644 --- a/includes/Plateau.hpp +++ b/includes/Plateau.hpp @@ -20,11 +20,14 @@ public: Plateau(const Plateau &); // copy constructor const Plateau &operator=(const Plateau &); // copy assignement - // Fonction pour initialiser le plateau + // Fonction pour initialiser le plateau (selon le jeu) + virtual void initialiserPlateau(); - // Fonction pour afficher le plateau + // Fonction pour afficher le plateau (selon le jeu) + void afficherPlateau(); // Fonction pour modifier le plateau + void modifierPlateau(int x, int y, Piece *piece); }; #endif diff --git a/src/Plateau.cpp b/src/Plateau.cpp index 3ed6339..93a20b5 100644 --- a/src/Plateau.cpp +++ b/src/Plateau.cpp @@ -21,3 +21,15 @@ const Plateau &Plateau::operator=(const Plateau &src) { return *this; } + +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"); + } +}