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

📄 mainwnd.h

📁 一个五子棋游戏的简单程序,可供大家娱乐,学习
💻 H
字号:
// MainWnd.h : CMainWnd 类的接口
//


#pragma once
#include "Mmsystem.h"
#pragma comment(lib, "winmm.lib")

//电脑AI类
class classAI
{
public:
	int count;
	int sumpt;
	CPoint pt;
public:
	classAI():count(0),sumpt(0){pt=CPoint(0,0);}
//	classAI(const classAI &ai){a=ai.a;b=ai.b;count=ai.count;}
//	classAI& operator=(const classAI &ai){a=ai.a;b=ai.b;count=ai.count;return *this;}
};

//电脑AI类定义结束   

class CMainWnd : public CWnd
{
	
public:
	CMainWnd();
protected: 
	DECLARE_DYNAMIC(CMainWnd)

// 属性
public:

// 操作
public:

// 重写
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);

// 实现
public:
	virtual ~CMainWnd();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// 生成的消息映射函数
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnPaint();
protected:
	 CRect m_rcSquares[10][10];
	 int m_nGrid[10][10];
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnButtonClicked();
	afx_msg void OnFirstClicked();
	afx_msg void OnSoundClicked();
public:
	void DrawWhite(CRect rect);
	void DrawBlack(CRect rect);
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
public:
	BOOL Check(int x,int y);
public:
	void ComputerDown(CPoint &pt);
public:
	CPoint GetPosition();
public:
	BOOL m_cmpturn;
public:
	void SaveAI(classAI &ai);
public:
	CArray<classAI,classAI> AIarray;
public:
	CButton* pbtRestart;
public:
	CButton* pbtFirst;
public:
	int m_nVictory;
public:
	int m_nLoss;
public:
	float m_fScale;
public:
	CButton* pbtSound;
};


⌨️ 快捷键说明

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