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

📄 chessdlg.h

📁 一个人工智能下象棋的小游戏 含电子书 包含了alph-beta 深度优先 极大极小值算法
💻 H
字号:
// ChessDlg.h : header file
//

#if !defined(AFX_CHESSDLG_H__8B4D2DD4_F805_4D34_BF2D_A7B38F6579A1__INCLUDED_)
#define AFX_CHESSDLG_H__8B4D2DD4_F805_4D34_BF2D_A7B38F6579A1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "NegaMaxEngine.h"
#include "SearchEngine.h"

typedef struct _movechess
{
	BYTE nChessID;
	POINT ptMovePoint;
}MOVECHESS;
/////////////////////////////////////////////////////////////////////////////
// CChessDlg dialog

class CChessDlg : public CDialog
{
// Construction
public:
	CChessDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CChessDlg)
	enum { IDD = IDD_CHESS_DIALOG };
	CEdit	m_OutputInfo;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChessDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	// Generated message map functions
	//{{AFX_MSG(CChessDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnNewGame();
	afx_msg void OnAboutbox();
	afx_msg void OnBack();
	afx_msg void OnRedai();
	afx_msg void OnUnredai();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	BOOL IsGameOver(BYTE position[10][9]);
	BOOL bGameOver;
	BYTE m_ChessBoard[10][9];//棋盘的定义
	BYTE m_BackupChessBoard[10][9];//备份棋盘数组,用于出错恢复
	BYTE m_BoardForBack[3][10][9];//用于悔棋
	MOVECHESS m_MoveChess;//用于保存当前被拖拽的棋子的结构
	POINT m_ptMoveChess;//用于保存当前被拖拽的棋子的位置
	CBitmap m_BoardBmp;//bitmap图用于显示棋盘
	CImageList m_Chessman;//用于绘制棋子的ImageList对象
	int m_nBoardWidth;//棋盘宽度
	int m_nBoardHeight;//棋盘高度
	CSearchEngine * m_pSE;//搜索引擎指针
	CSearchEngine * m_pSE_Red;//红方为AI时搜索引擎指针
	BOOL IsRedAi;//红色为AI是值为true
	int m_nForBackup;//保存3副棋盘,标明是哪一副
	int m_backcount;//最多悔棋3次,记录可以悔棋的次数
	BOOL m_whowin;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHESSDLG_H__8B4D2DD4_F805_4D34_BF2D_A7B38F6579A1__INCLUDED_)

⌨️ 快捷键说明

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