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

📄 zllkview.h

📁 连连看小游戏
💻 H
字号:
// ZLLKView.h : interface of the CZLLKView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_ZLLKVIEW_H__56853A11_9283_40EE_BAF4_1B92862204F0__INCLUDED_)
#define AFX_ZLLKVIEW_H__56853A11_9283_40EE_BAF4_1B92862204F0__INCLUDED_

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

#define DRAW_TOP    49  
#define DRAW_LEFT   80

#define PIC_WIDTH   44
#define PIC_HEIGHT  54

#define BMP_WIDTH   40
#define BMP_HEIGHT  49

#define LINE_NUMBER 10   // 列
#define ROW_NUMBER  9   // 行

#define VIRTUAL_LINE 12   // 列
#define VIRTUAL_ROW  11   // 行

typedef struct _ZYHLLK_MAP
{
	int PicIndex;
	int state;       //0 为没有点击  1为点击一次 2为点击两次
	int event;	     //0 没有事件    1:奖励提示1次 2:奖励重列1次 3: 奖励分数100
}ZYHLLK_MAP;

typedef struct _ZYHLLK_PATH
{
	int  x;
	int  y;
	_ZYHLLK_PATH *next;
}ZYHLLK_PATH,*LPZYHLLK_PATH;

typedef struct  _PIC_PLACE
{
	int x;
	int y;
}PIC_PLACE,*LPPIC_PLACE;
class CZLLKView : public CView
{
protected: // create from serialization only
	CZLLKView();
	DECLARE_DYNCREATE(CZLLKView)

// Attributes
public:
	CZLLKDoc* GetDocument();

// Operations
public:
	CBitmap       bitmap1; 
	CBitmap       bitmap2; 
	ZYHLLK_MAP    llk_map[ROW_NUMBER+2][LINE_NUMBER+2];  //地图
	int           pic_number[15];     // 纪录图片的个数
	LPZYHLLK_PATH pic_place[16];      // 记录图片所有位置,用来判断无解和提示
	LPZYHLLK_PATH conncetPath;        // 路径链表
	int           xindex,yindex;      // 位置

	int           m_nUpper;	          // 进度条上限
	int           m_nSpeed;           // 进度条速度	

	int           m_tishinumber;      // 提示次数
	int           m_sortnumber;       // 重列次数
	int           m_dotNumber;        // 连击次数
	bool          bingame;            // 是不是在游戏中 
	bool          bSecondClicked;     // 判断是不是第二次点击
    bool          bsuccess;           
	bool          bsoundeffect;      // 菜单中用来记录当前声音状态
	bool          bmusic;    
    bool          bfirst;             // 是不是初级
    bool          bstop;              // 是否暂停
	//int*          m_pic;            // 创建一个整形动态数组
	
	void          InitMap();          // 初始化地图 
	void          InitEvent();        // 初始化事件
     
	void          DrawMap();
	void          DrawBlank();
	void          DrawFace(int xindex,int yindex,int PicIndex,int state);
	void          DrawFaceBlank(int xindex,int yindex);

	void          DrawInfo(int x,int y,CString str);
	void          DrawInfo2(int x,int y,int i);
	void          DrawInfo3(int x,int y,CString str);
	void          DrawProgress(int progress);
	void          DrawRectangleHollow();
    bool          CheckConnection(int x1, int y1, int x2, int y2); //判断是否可达 
	bool          IsLineConnection(int x1, int y1, int x2, int y2); //判断直线两点是不是可连通的
    bool          IsLinePicEmpty(int x1, int y1, int x2, int y2); //判断除起始点 图片是否为空
	bool          IsNotLineConnection(int x1, int y1, int x2, int y2);
	
	void          AddPicPlace(int picindex,int x,int y);  //添加图片位置
	void          ReleasePicPlace(int picindex,int x,int y);//释放图片位置
	LPZYHLLK_PATH QueryPicPlace(int picindex,int x,int y);
	void          ListPicPlace();        // 列出图片的所有位置
	//int*          GetPlaceInfo();      // 获取每个位置上的图片信息,
	                                     // 输出为整形数组,数组元素为图片编号

    void          BackPicPlace();        // 提示
    void          SortPicPlace();        // 重列
	bool          IsNoConnection();      // 是不是无解
	bool          IsPicEmpty();          // 是否已经消完
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CZLLKView)
	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 ~CZLLKView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CZLLKView)
	afx_msg void OnMenuScore();
	afx_msg void OnMenuFirst();
	afx_msg void OnUpdateMenuFirst(CCmdUI* pCmdUI);
	afx_msg void OnMenuBack();
	afx_msg void OnUpdateMenuBack(CCmdUI* pCmdUI);
	afx_msg void OnMenuExit();
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMenuInfo();
	afx_msg void OnUpdateMenuInfo(CCmdUI* pCmdUI);
	afx_msg void OnMenuSort();
	afx_msg void OnUpdateMenuSort(CCmdUI* pCmdUI);
	afx_msg void OnMenuStop();
	afx_msg void OnUpdateMenuStop(CCmdUI* pCmdUI);
	afx_msg void OnMenuEffect();
	afx_msg void OnUpdateMenuEffect(CCmdUI* pCmdUI);
	afx_msg void OnMenuMusic();
	afx_msg void OnUpdateMenuMusic(CCmdUI* pCmdUI);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnMenuHelp();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in ZLLKView.cpp
inline CZLLKDoc* CZLLKView::GetDocument()
   { return (CZLLKDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_ZLLKVIEW_H__56853A11_9283_40EE_BAF4_1B92862204F0__INCLUDED_)

⌨️ 快捷键说明

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