The Pedigree Project  0.1
SearchAlgorithm.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 SEARCHALGORITHM_H
22 #define SEARCHALGORITHM_H
23 
24 #include <list>
25 #include "Move.h"
26 
27 typedef std::list<Move> MoveList;
28 
29 #include "BoardState.h"
30 
35 {
36 public:
37  SearchAlgorithm(volatile bool *keepGoing);
38  virtual ~SearchAlgorithm() {}
39 
40  virtual long search(Side side, int maxDepth, class BoardState state, MoveList &moveList) = 0;
41 
42  unsigned long nodesSearched;
43 
44 protected:
45  volatile bool *m_KeepGoing;
46 };
47 
48 #endif