⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 movegenerator.h

📁 用c++ 开发的中国象棋
💻 H
字号:
// MoveGenerator.h: interface for the CMoveGenerator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MOVEGENERATOR_H__2937AC6E_5970_4B64_BF40_00E0232261F8__INCLUDED_)
#define AFX_MOVEGENERATOR_H__2937AC6E_5970_4B64_BF40_00E0232261F8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "define.h"

class CMoveGenerator  
{
public:
	CMoveGenerator();
	virtual ~CMoveGenerator();

public:
    BOOL IsValidMove(BYTE position[10][9], int nFromX, int nFromY, int nToX, int nToY,int nUserChessColor);
	int CreatePossibleMove(BYTE position[][9],int nDeep,int nSide,int nUserChessColor);
	BOOL IsGameOver(BYTE ChessManPos[10][9]);
protected:
	void GenBlackSoldierMove(BYTE position[10][9],int i,int j,int nDeep);  
	//产生黑卒的走法,nDeep表明插入到List第几层
	void GenRedSoldierMove(BYTE position[10][9], int i,int j,int nDeep);  
	//产生红兵的走法,nDeep表明插入到List第几层

	void GenBlackAssistMove(BYTE position[10][9],int i,int j,int nDeep);
	//产生黑士的走法,nDeep表明插入到List第几层
	void GenRedAssistMove(BYTE position[10][9],int i,int j,int nDeep);
	//产生红士的走法,nDeep表明插入到List第几层

	void GenRookMove(BYTE position[10][9], int i,int j,int nDeep);    
	//产生车的走法,nDeep表明插入到List第几层
	void GenHourseMove(BYTE position[10][9], int i,int j,int nDeep); 
	//产生马的走法,nDeep表明插入到List第几层
	void GenBishopMove(BYTE position[10][9],int i,int j,int nDeep);
	//产生相/象的走法,nDeep表明插入到List第几层

	void GenRedKingMove(BYTE position[10][9],int i,int j,int nDeep);
	//产生帅的走法,nDeep表明插入到List第几层
	void GenBlackKingMove(BYTE position[10][9],int i,int j,int nDeep);
	//产生将的走法,nDeep表明插入到List第几层

	void GenGunnerMove(BYTE position[10][9],int i,int j,int nDeep);  
	//产生炮的走法,nDeep表明插入到List第几层

	int AddMove(int nFromX,int nToX,int nFromY,int nToY,int nDeep,int nChessID);
	//在m_MoveList中插入一个走法,nDeep表明插入到List第几层

public:
	ChessMove m_MoveList[8][80];//存放CreatePossibleMove产生的所有走法的队列
	int m_nMoveCount;//记录m_MoveList中走法的数量
	int m_nUserChessColor;
};

#endif // !defined(AFX_MOVEGENERATOR_H__2937AC6E_5970_4B64_BF40_00E0232261F8__INCLUDED_)

⌨️ 快捷键说明

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