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

📄 rusblockview.h

📁 程序中只用了七种基本图形来实现总共的28种形状,因其采用了一种算法
💻 H
字号:
// RusBlockView.h : interface of the CRusBlockView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_RUSBLOCKVIEW_H__E9660AA5_CEF4_439F_ABCD_185597E5F097__INCLUDED_)
#define AFX_RUSBLOCKVIEW_H__E9660AA5_CEF4_439F_ABCD_185597E5F097__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 tagComponet
{
	int intComID;
	int intDimension;
	int * pintArray;
}Componet;


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
	private:
		int m_intComID;
		int m_intState[HIGH][WIDE];
		Componet m_Componets[MAXCOM];
		int m_intScore;
		int m_intLevel;
		Componet m_CurrentCom;
		POINT ptIndex;
		void NewComponet(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();
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 OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnGameStart();
	afx_msg void OnGameEnd();
	afx_msg void OnLevelNormal();
	afx_msg void OnLevelHard();
	afx_msg void OnLevelEasy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#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__E9660AA5_CEF4_439F_ABCD_185597E5F097__INCLUDED_)

⌨️ 快捷键说明

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