1 | /******************************************************************* |
2 | * |
3 | * Copyright 2013 Denis Kuplyakov <dener.kup@gmail.com> |
4 | * |
5 | * This file is part of the KDE project "KReversi" |
6 | * |
7 | * KReversi is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2, or (at your option) |
10 | * any later version. |
11 | * |
12 | * KReversi is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU General Public License |
18 | * along with KReversi; see the file COPYING. If not, write to |
19 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
20 | * Boston, MA 02110-1301, USA. |
21 | * |
22 | ********************************************************************/ |
23 | |
24 | #ifndef KREVERSICOMPUTERPLAYER_H |
25 | #define KREVERSICOMPUTERPLAYER_H |
26 | |
27 | #include <kreversiplayer.h> |
28 | |
29 | /** |
30 | * Represents computer or AI of this game. Implements KReversiPlayer. |
31 | * |
32 | * @see KReversiPlayer |
33 | */ |
34 | class KReversiComputerPlayer : public KReversiPlayer |
35 | { |
36 | Q_OBJECT |
37 | public: |
38 | /** |
39 | * Constructs AI player of specified @p color and @p name |
40 | */ |
41 | explicit KReversiComputerPlayer(ChipColor color, QString name); |
42 | ~KReversiComputerPlayer(); |
43 | |
44 | /** |
45 | * Overridden slots from @see KReversiPlayer |
46 | */ |
47 | void prepare(KReversiGame *game); |
48 | void takeTurn(); |
49 | void skipTurn(); |
50 | void gameOver(); |
51 | |
52 | /** |
53 | * Sets computer skill |
54 | * @param skill Skill level from 1 to 7 |
55 | */ |
56 | void setSkill(int skill); |
57 | |
58 | /** |
59 | * @return lowest skill that has been set |
60 | */ |
61 | int lowestSkill(); |
62 | |
63 | signals: |
64 | |
65 | public slots: |
66 | |
67 | private: |
68 | int m_lowestSkill; |
69 | Engine *m_engine; |
70 | }; |
71 | |
72 | #endif // KREVERSICOMPUTERPLAYER_H |
73 | |