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

📄 rusblockview.h

📁 在学习MFC过程中可以试着多写点东西
💻 H
字号:
// RusBlockView.h : interface of the CRusBlockView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_RUSBLOCKVIEW_H__BE69F694_0338_4B41_9A44_28180C618DA1__INCLUDED_)
#define AFX_RUSBLOCKVIEW_H__BE69F694_0338_4B41_9A44_28180C618DA1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define MAXCOM 7
#define WIDE 13
#define HIGH 26
#define SIZE 12
#define TOP 50
#define LEFT 50
#define EASY 500
#define NORMAL 300
#define HARD 200

typedef struct tagComponent
{
	int intComID;
	int intDimension;
	int * pintArray;
}Component;



class CRusBlockView : public CView
{
protected: // create from serialization only
	CRusBlockView();
	DECLARE_DYNCREATE(CRusBlockView)

// Attributes
public:
	CRusBlockDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRusBlockView)
	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

// Implementation
public:
	virtual ~CRusBlockView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CRusBlockView)
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnGameStart();
	afx_msg void OnGameEnd();
	afx_msg void OnLevelEasy();
	afx_msg void OnLevelHard();
	afx_msg void OnLevelNormal();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	int m_intComID;
	int m_intState[HIGH][WIDE];
	Component m_Components[MAXCOM];
	int m_intScore;
	int m_intLevel;
	Component m_CurrentCom;
	POINT ptIndex;
	void NewComponent(void);
	bool CanDown(void);
	void MyInvalidateRect(POINT ptStart,int intDimension);
	void Disappear(void);
	bool CheckFail(void);
	bool CanRotate(void);
	bool CanLeft(void);
	bool CanRight(void);
	bool CanNew();
};

#ifndef _DEBUG  // debug version in RusBlockView.cpp
inline CRusBlockDoc* CRusBlockView::GetDocument()
   { return (CRusBlockDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_RUSBLOCKVIEW_H__BE69F694_0338_4B41_9A44_28180C618DA1__INCLUDED_)

⌨️ 快捷键说明

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