sanity check and error messages
This commit is contained in:
parent
7f9d100aee
commit
c074ba7ae2
4 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,7 @@ std::string PieceButin::to_string(const enum Categorie cat) const {
|
|||
return "Noire";
|
||||
|
||||
default:
|
||||
std::cerr << "Catégorie inconnue (PieceButin).\n";
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,6 +55,10 @@ bool Dames::prisePossible(Joueur &joueur) const {
|
|||
int y = 1;
|
||||
for (int i = 0; i < pieces.size(); i++) {
|
||||
PieceDames *p = dynamic_cast<PieceDames *>(pieces[i]);
|
||||
if (!p) {
|
||||
std::cerr << "Cette pièce est.. étrange.\n";
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (p->getDame()) {
|
||||
// if(plateau[x][y] == nullptr)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ std::string PieceDames::to_string(const enum Categorie cat) const {
|
|||
return "Noire";
|
||||
|
||||
default:
|
||||
std::cerr << "Catégorie inconnue (PieceDames).\n";
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ std::string PieceSafari::to_string(const enum Categorie cat) const {
|
|||
return "Lion";
|
||||
|
||||
default:
|
||||
std::cerr << "Catégorie inconnue (PieceSafari).\n";
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue