📄 gameview.h
字号:
// GameView.h : interface of the CGameView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GAMEVIEW_H__FDB8EB81_EE2C_4BCD_B1D4_74DAFEC1937B__INCLUDED_)
#define AFX_GAMEVIEW_H__FDB8EB81_EE2C_4BCD_B1D4_74DAFEC1937B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WM_BEGIN WM_USER+1
#define WM_GO WM_USER+2
#define WM_CHANGE WM_USER+3
#define WM_OVER WM_USER+4
struct RECVPARAM
{
SOCKET sock;
HWND hwnd;
};
class CGameView : public CView
{
protected: // create from serialization only
CGameView();
DECLARE_DYNCREATE(CGameView)
// Attributes
public:
CGameDoc* GetDocument();
static DWORD WINAPI RecvProc(LPVOID lpParameter);
SOCKET m_socket;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGameView)
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);
//}}AFX_VIRTUAL
afx_msg void OnBeginGame(WPARAM wParam,LPARAM lParam);
afx_msg void OnGoGame(WPARAM wParam,LPARAM lParam);
afx_msg void OnChange(WPARAM wParam,LPARAM lParam);
afx_msg void OnOver(WPARAM wParam,LPARAM lParam);
// Implementation
public:
void Init();
void DrawPerson(int x1, int y1, int x2, int y2, int flag, int flag2=0);
void GameOver();
int my;
int mx;
int ny;
int nx;
void Move(UINT nChar);
void SendMessage(char*strSend,SOCKADDR_IN addrTo);
BOOL InitSocket();
void DrawMap();
virtual ~CGameView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGameView)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in GameView.cpp
inline CGameDoc* CGameView::GetDocument()
{ return (CGameDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GAMEVIEW_H__FDB8EB81_EE2C_4BCD_B1D4_74DAFEC1937B__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -