2 Mancala - A Historical Board Game
3 Copyright (C) 2009-2010 A.H.M.Mahfuzur Rahman 65mahfuz90@gmail.com
4 Copyright (c) 2010 Reto Zingg g.d0b3rm4n@gmail.com
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef MOVEGENERATOR_H
22 #define MOVEGENERATOR_H
26 // #include <kdebug.h>
36 MoveGenerator(int gameDifficulty,GameInfo *gameInfo,GameController *gameController);
38 void changeDifficulty(int gameDifficulty){
39 // kDebug() << "GameDifficulty Changed to: " << gameDifficulty;
40 m_gameDifficulty = gameDifficulty;
42 //Will be called when we need a move and pass the current board state
43 int bestMove(QList<int> ,bool );
44 int maxValue(Node *currentNode,int alpha,int beta);
45 int minValue(Node *currentNode,int alpha,int beta);
47 void copyBoard(Node* to,Node* from);
48 void copyBoard(Node *to,QList<int>board);
49 void simulateMoves(Node *currentNode,QList<Node*>& );
51 bool isGameOver(QList<int> board);
52 void showBoardState(Node* node);
57 QList<int> allCupIndexes;
58 QList<int> allEvaluations;
60 GameController* m_gameController;
67 //Node of the Minimax Tree
71 Node(GameInfo *gameInfo);
73 int evaluationFunction(GameController* controller);
74 QList<int> getBoard(){ return m_boardState; }
75 void setBoard(QList<int>board);
77 void setDepth(int depth){ m_depth = depth;}
78 void setTurn(bool turn){ m_humanTurn = turn;}
79 void setMove(int move){ m_move = move;}
81 int depth() const{ return m_depth;}
82 int move() const{return m_move;}
83 bool turn() const{ return m_humanTurn;}
91 QList<int> m_boardState;
92 int m_move; //from which cup the move has been generated
95 #endif // MOVEGENERATOR_H