Cute Chess  0.1
ncheckboard.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef NCHECKBOARD_H
19 #define NCHECKBOARD_H
20 
21 #include "standardboard.h"
22 
23 namespace Chess {
24 
39 class LIB_EXPORT NCheckBoard : public StandardBoard
40 {
41  protected:
47  NCheckBoard(int n = 3);
48  public:
49  // Inherited from StandardBoard
50  virtual Board* copy() const;
51  virtual QString variant() const;
52  virtual QString defaultFenString() const;
53  virtual Result result();
54 
56  int checksToWin(Side side) const;
57 
58  protected:
59  // Inherited from StandardBoard
60  virtual void vInitialize();
61  virtual QString vFenIncludeString(FenNotation notation) const;
62  virtual bool vSetFenString(const QStringList& fen);
63  virtual void vMakeMove(const Move& move,
64  BoardTransition* transition);
65  virtual void vUndoMove(const Move& move);
66 
68  int checkLimit() const;
69 
70  private:
71  int m_checkLimit;
72  int m_checksToWin[2];
73  void setChecksToWin(int whiteCount, int blackCount);
74  void updateCheckCounters(Side side, int d);
75 };
76 
84 class LIB_EXPORT ThreeCheckBoard : public NCheckBoard
85 {
86  public:
88  virtual Board* copy() const;
89 };
90 
98 class LIB_EXPORT FiveCheckBoard : public NCheckBoard
99 {
100  public:
101  FiveCheckBoard();
102  virtual Board* copy() const;
103 };
104 
105 } // namespace Chess
106 #endif // NCHECKBOARD_H
FenNotation
Definition: board.h:92
An internal chessboard class.
Definition: board.h:56
A board for N-Check Chess.
Definition: ncheckboard.h:39
A board for Three-Check Chess (Wild 25)
Definition: ncheckboard.h:84
Definition: boardscene.h:28
The side or color of a chess player.
Definition: side.h:34
A board for Five-Check Chess.
Definition: ncheckboard.h:98
The result of a chess game.
Definition: result.h:33
A board for standard chess.
Definition: standardboard.h:37
Details of a board transition caused by a move.
Definition: boardtransition.h:39
A small and efficient chessmove class.
Definition: move.h:41