forked from JayfonLin/chessserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch_engine.h
51 lines (41 loc) · 1.08 KB
/
search_engine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SEARCH_ENGINE_H
#define SEARCH_ENGINE_H
/*
Created on 2015-09-03
@author:jeff
*/
#include "constant.h"
#include "chess_move.h"
#include "move_generator.h"
#include "evaluation.h"
#include "chess_util.h"
#include <iostream>
using std::cout;
using std::endl;
class CSearchEngine
{
protected:
int m_cur_position[BOARD_NUMBER];
CHESS_MOVE m_best_move;
CMoveGenerator* m_move_generator;
CEvaluator* m_evaluator;
int m_search_depth;
int m_max_depth;
int m_move_count;
CHESS_MOVE m_move_list[10][80];
void InitMoveList();
virtual bool SearchAGoodMove(int squares[]) = 0;
virtual int MakeMove(CHESS_MOVE move);
virtual void UnmakeMove(CHESS_MOVE move, int chess_id);
virtual int IsGameOver(int squares[], int depth);
const static int DEFAULT_SEARCH_DEPTH = 4;
public:
CSearchEngine();
virtual ~CSearchEngine();
virtual inline void SetBestMove(CHESS_MOVE move);
virtual inline CHESS_MOVE GetBestMove();
virtual inline void SetSearchDepth(int depth);
virtual inline void SetEvaluator(CEvaluator* evaluator);
virtual inline void SetMoveGenerator(CMoveGenerator* generator);
};
#endif