searchagent.h

来自「EVC4.0开发的国际象棋的元代码」· C头文件 代码 · 共 33 行

H
33
字号
/****************************************************
Author: S. Senthil kumar
Class Name: Search Agent
Purpose:    The Game Engine. Selects best move

******************************************************/

class SearchAgent
{

	int actualcolor;		//Which side should the best move be found
	int actualdepth;		//What is the depth to be searched
	int maxval;				//Max value to search
	int minval;				//Min value to search
	OneMove currentmove;	 //Stores the current move being analysed.
	OneMove player_bestmove;  //Stores the best move found
	//OneMove opponent_bestmove;
	
public:
	int tempboard[8][8];		//Temporary board
	int checkmate;				//Whether checkmate occurred during search
	
	int RetVal;					//The Value returned by the Search routine
	int checking_for_mate;		//Boolean variable to indicate whether call is from CheckForCheckMate()
	
	
	//CString GetBoardArray(int board[8][8]);
	SearchAgent(int color,int board[8][8],int depth,int alpha,int beta,int chformate=0);//Constructor
	int RealSearch(int currentcolor,int cboard[8][8],int depth,int alpha,int beta); //The Real Game Engine. Recursively called depth times and then moves up to find the best move
	void ApplyMove(int currentboard[8][8],OneMove *temp);							//To move the piece in the board
	OneMove getBestMove();															//Returns best move
	int eval(int currentboard[8][8],int color);			//Evaluation function that evaluates the current board position.						
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?