Cute Chess  0.1
humanplayer.h
1 /*
2  This file is part of Cute Chess.
3  Copyright (C) 2008-2018 Cute Chess authors
4 
5  Cute Chess is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Cute Chess is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef HUMANPLAYER_H
20 #define HUMANPLAYER_H
21 
22 #include "chessplayer.h"
23 #include "board/genericmove.h"
24 
25 
36 class LIB_EXPORT HumanPlayer : public ChessPlayer
37 {
38  Q_OBJECT
39 
40  public:
42  HumanPlayer(QObject* parent = nullptr);
43 
44  // Inherted from ChessPlayer
45  virtual void endGame(const Chess::Result& result);
46  virtual void makeMove(const Chess::Move& move);
47  virtual bool supportsVariant(const QString& variant) const;
48  virtual bool isHuman() const;
49 
50  public slots:
61  void onHumanMove(const Chess::GenericMove& move,
62  const Chess::Side& side);
63 
64  signals:
72  void wokeUp();
73 
74  protected:
75  // Inherited from ChessPlayer
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:38
virtual void startThinking()=0
A chess move independent of chess variant or opening book format.
Definition: genericmove.h:34
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:35
The result of a chess game.
Definition: result.h:34
virtual void endGame(const Chess::Result &result)
Definition: chessplayer.cpp:74
A small and efficient chessmove class.
Definition: move.h:42
A chess player controlled by a human user.
Definition: humanplayer.h:36
virtual bool isHuman() const =0
virtual void startGame()=0