-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKing.hpp
45 lines (37 loc) · 900 Bytes
/
King.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Fichier contenant la classe King qui correspond au roi.
* \file King.hpp
* \author Erreur-404 et Mo-LK
* \date 19 avril 2022
* Cr�� le 8 avril 2022
*/
#pragma once
#include <stdexcept>
#include "AbsPiece.hpp"
namespace model
{
class King : public AbsPiece
{
public:
King() = default;
King(int x, int y, const Color& color);
virtual ~King();
protected:
/*
* Indique si le mouvement correspond � ceux permis par le Roi
* \param x : Nouvelle position en x
* \param y : Nouvelle position en y
* \return La validit� du mouvement
*/
bool isValidPieceMove(int x, int y) const override;
private:
/* Le nombre de rois pr�sents sur l'�chiquier */
static int numberOfKings_;
};
/* Erreur lanc�e lorsqu'on tente d'ins�rer plus de 2 rois */
class TooManyKingsException: public std::logic_error
{
public:
using std::logic_error::logic_error;
};
}