SVN_SILENT made messages (.desktop file)
[kdegames.git] / bovo / ai / ai.h
blobb4743060a7ddcee95b3e678aca6e3d0d59690bf8
1 /*******************************************************************
3 * This file is part of the KDE project "Bovo"
5 * Bovo 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 2, or (at your option)
8 * any later version.
10 * Bovo 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.
15 * You should have received a copy of the GNU General Public License
16 * along with Bovo; see the file COPYING. If not, write to
17 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
20 ********************************************************************/
23 /**
24 * @file ai.h declaring the Ai class
27 #ifndef __AI_H__
28 #define __AI_H__
30 #include <QObject>
32 #include <kgamedifficulty.h>
34 #include "common.h"
36 using namespace bovo;
38 /** namespace for game engine */
39 namespace bovo {
40 class Move;
41 class Coord;
42 class Dimension;
43 } /* namespace bovo */
45 /** namespace for AI stuff */
46 namespace ai {
48 class AiBoard;
50 /**
51 * An AI player
53 * @code
54 * Dimension dimension(width, height);
55 * Ai ai(dimension, Easy);
56 * Coord move = getMoveFromPlayerEitherByNetworkOrGui();
57 * Coord aiMove = ai.move(move);
58 * doSomethingWithAiMoveLikeDisplayingItInTheGui(aiMove);
59 * @endcode
61 class Ai : public QObject {
62 Q_OBJECT
63 public:
64 /**
65 * @brief Constructs an Ai with width, height, player and Skill
66 * @description Constructs an AI player with a specified width, height and
67 * skill as well as player id
68 * @param dimension the dimension controlling width and height
69 * @param skill the skill (difficulty level) the AI player will be playing with
70 * @param player player id of this AI
72 explicit Ai(const Dimension& dimension, KGameDifficulty::standardLevel skill = KGameDifficulty::Medium, Player player = X);
74 /**
75 * @brief destructs this Ai
76 * @description destructs this AiBoard object
78 ~Ai();
80 public slots:
81 void changeBoard(const Move& move);
82 void gameOver();
83 void setSkill(KGameDifficulty::standardLevel skill);
84 void slotMove();
86 signals:
87 void move(const Move& move);
89 private:
90 /* Playing board */
91 AiBoard *m_board;
93 /* AI Player id */
94 Player m_player;
97 } /* namespace ai */
99 #endif /* __AI_H__ */