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

📄 mychessview.h

📁 一个用MFC做的象棋游戏,可以联网双人对下,
💻 H
字号:
// MyChessView.h : interface of the CMyChessView class
//

#ifndef CVIEW_H_
#define  CVIEW_H_
#pragma once
#include "MyChessDoc.h"
#include "CServerSocket.h"
#include "CClientSOcket.h"
#include "talkDiag.h"
#include "afxwin.h"
class talkDiag;
class CServerSocket;
class CClientSocket;
class CMyChessView : public CView
{
protected: // create from serialization only
	CMyChessView();
	DECLARE_DYNCREATE(CMyChessView)

// Attributes
public:
	CMyChessDoc* GetDocument() const;
public:

     CServerSocket *m_pServerSocket;
	 CClientSocket *m_pClientSocket;
	 talkDiag *m_myTalk;
	 bool m_bIfLButtonDownMe;
	 bool m_bIfAFinished;
     bool m_bIfBFinished;
	 bool m_bIfACanGo;
	 bool m_TalkDlg;
	 bool m_bIfStart;
	 bool m_bHeStart;
	 bool m_bRegretFrom;//判断回棋消息的来源
	 bool m_bMessFrom;//判断信息是从那里发送过来的
	 bool m_bAgreeRegret;//是否同意回棋
	 bool jishi;//用来计时的
	 bool setJISHIToZero;//用来在ondraw里是否清记时为零的标志
	 UINT uORow,uOCol;//指棋子的逻辑位置
	 UINT uNRow,uNCol;//指棋子的逻辑位置新位置
	 CPoint Npoint;//传过去的点的物理位置
public:
	//方法
	void ReceiveData(CClientSocket* socket);
	void AcceptConnect();
	void Regret();
public:
     CButton m_wndStartButton;
	 CButton m_wndRestartButton;
// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// Implementation
public:
	virtual ~CMyChessView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	bool SaveAs(HWND hWnd);
	bool Open(HWND hWnd);
protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnStartButtonClicked();
public:
	afx_msg void OnHelpConect();
public:
	afx_msg void OnOperatingTalk();
public:
	afx_msg void OnFileNew();
public:
	afx_msg void OnOperatingRegret();
public:
//	afx_msg void OnFileSaveAs();
public:
	afx_msg void OnFileSaveas();
public:
	afx_msg void OnFileOpen32776();
public:
//	afx_msg void OnOperatingNext();
public:
//	afx_msg void OnOperatingPrev();

public:
	CButton m_BtNext;
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
public:
	CButton m_BtPrev;
	CButton m_BtReview;
public:
	afx_msg void OnBtReview();
	afx_msg void OnBtPrev();
	afx_msg void OnBtNext();
};

#ifndef _DEBUG  // debug version in MyChessView.cpp
inline CMyChessDoc* CMyChessView::GetDocument() const
   { return reinterpret_cast<CMyChessDoc*>(m_pDocument); }
#endif

#endif

⌨️ 快捷键说明

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