Cute Chess  0.1
humanplayer.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 HUMANPLAYER_H
19 #define HUMANPLAYER_H
20 
21 #include "chessplayer.h"
22 #include "board/genericmove.h"
23 
24 
35 class LIB_EXPORT HumanPlayer : public ChessPlayer
36 {
37  Q_OBJECT
38 
39  public:
41  HumanPlayer(QObject* parent = nullptr);
42 
43  // Inherted from ChessPlayer
44  virtual void endGame(const Chess::Result& result);
45  virtual void makeMove(const Chess::Move& move);
46  virtual bool supportsVariant(const QString& variant) const;
47  virtual bool isHuman() const;
48 
49  public slots:
60  void onHumanMove(const Chess::GenericMove& move,
61  const Chess::Side& side);
62 
63  signals:
71  void wokeUp();
72 
73  protected:
74  // Inherited from ChessPlayer
75  virtual bool canPlayAfterTimeout() const;
76  virtual void startGame();
77  virtual void startThinking();
78 
79  private:
80  Chess::GenericMove m_bufferMove;
81 };
82 
83 #endif // HUMANPLAYER_H
A chess player, human or AI.
Definition: chessplayer.h:37
virtual bool canPlayAfterTimeout() const
Definition: chessplayer.cpp:196
virtual void startThinking()=0
A chess move independent of chess variant or opening book format.
Definition: genericmove.h:33
virtual bool supportsVariant(const QString &variant) const =0
virtual void makeMove(const Chess::Move &move)=0
The side or color of a chess player.
Definition: side.h:34
The result of a chess game.
Definition: result.h:33
virtual void endGame(const Chess::Result &result)
Definition: chessplayer.cpp:72
A small and efficient chessmove class.
Definition: move.h:41
A chess player controlled by a human user.
Definition: humanplayer.h:35
virtual bool isHuman() const =0
virtual void startGame()=0