📄 sgameview.h
字号:
// SGameView.h : interface of the CSGameView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_SGAMEVIEW_H__E849211C_D57E_4EB3_900F_52F639E55D4D__INCLUDED_)
#define AFX_SGAMEVIEW_H__E849211C_D57E_4EB3_900F_52F639E55D4D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CSGameView : public CView
{
protected: // create from serialization only
CSGameView();
DECLARE_DYNCREATE(CSGameView)
// Attributes
public:
CSGameDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSGameView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
//}}AFX_VIRTUAL
// Implementation
public:
CString m_strTopName;
CString m_strTopLevel;
CString m_strTopScore;
void GetData();
void LoadData();
void LevelUpdate();
int m_level; //等级
void GameOver();
void InitSnake();
virtual ~CSGameView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
void CreateFood();
//{{AFX_MSG(CSGameView)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnNewGame();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLevel1();
afx_msg void OnLevel2();
afx_msg void OnLevel3();
afx_msg void OnLevel4();
afx_msg void OnLevel5();
afx_msg void OnUpdateLevel1(CCmdUI* pCmdUI);
afx_msg void OnUpdateLevel2(CCmdUI* pCmdUI);
afx_msg void OnUpdateLevel3(CCmdUI* pCmdUI);
afx_msg void OnUpdateLevel4(CCmdUI* pCmdUI);
afx_msg void OnUpdateLevel5(CCmdUI* pCmdUI);
afx_msg void OnMrhero();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL bUpdated;
CString m_score;
CString m_strLevel;
};
#ifndef _DEBUG // debug version in SGameView.cpp
inline CSGameDoc* CSGameView::GetDocument()
{ return (CSGameDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SGAMEVIEW_H__E849211C_D57E_4EB3_900F_52F639E55D4D__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -