The Pedigree Project  0.1
Minimax.h
1 /*
2  *
3  * Copyright (c) 2008-2014, Pedigree Developers
4  *
5  * Please see the CONTRIB file in the root of the source tree for a full
6  * list of contributors.
7  *
8  * Permission to use, copy, modify, and distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #ifndef MINIMAX_H
22 #define MINIMAX_H
23 
24 #include "BoardState.h"
25 #include "SearchAlgorithm.h"
26 
27 class Minimax : public SearchAlgorithm
28 {
29 public:
30  Minimax(volatile bool *keepGoing);
31  ~Minimax();
32 
33  virtual long search(Side side, int maxDepth, BoardState state, MoveList &moveList);
34 
35 private:
36  long doSearch(Side side, int curDepth, bool isMaximising, int maxDepth, BoardState state, MoveList &moveList);
37 };
38 
39 #endif