📄 programview.h
字号:
// programView.h : interface of the CProgramView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PROGRAMVIEW_H__A3683800_B062_444D_A3E6_F47B9EE6C3B2__INCLUDED_)
#define AFX_PROGRAMVIEW_H__A3683800_B062_444D_A3E6_F47B9EE6C3B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#define FSCommand 150
#include "Chess.h"
#include "shockwaveflash.h"
class CProgramView : public CView
{
protected: // create from serialization only
CProgramView();
DECLARE_DYNCREATE(CProgramView)
// Attributes
public:
CShockwaveFlash m_cflash;
CProgramDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProgramView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
int roll;//丢的roll的数字
int control;//控制筛子以及飞机的点击
int timer;
int planenum;
//定义绘图用的CDC
CDC Background;//背景
CDC Greenplane;//绿色的飞机
CDC Greenmask;//绿色飞机的mask
CDC Redplane;//红色飞机
CDC Redmask;//红色飞机的mask
CDC Yellowplane;//黄色飞机
CDC Yellowmask;//黄色飞机的mask
CDC Blueplane;//蓝色飞机
CDC Bluemask;//蓝色飞机的mask
CDC Num;//掷骰子所得的数字
//定义加载位图CBitmap
CBitmap m_background;
CBitmap m_greenplane;
CBitmap m_greenmask;
CBitmap m_redplane;
CBitmap m_redmask;
CBitmap m_yellowplane;
CBitmap m_yellowmask;
CBitmap m_blueplane;
CBitmap m_bluemask;
CBitmap m_roll;
//定义棋子的对象
Chess lastplane[16];//用来记录上次16架飞机的状态
Chess *plthis;//用来指向Managers中的Planes的指针,减少代码,方便操作
// Implementation
public:
virtual ~CProgramView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CProgramView)
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_EVENTSINK_MAP()
afx_msg void OnFSCommandFlash(LPCTSTR command, LPCTSTR args);
DECLARE_MESSAGE_MAP()
private:
bool isOntimer;
void PrintState(CDC *pdc);//用来打印当前的游戏状态
bool SelectPlane(Chess plane,int mx,int my);//判断当前所选的飞机,如果选
//中飞机,则返回TRUE,否则返回FALSE
void PlaneUpdata();//更新laseplane[16]中的飞机状态
void PrintAll(CDC *pdc);//画出当前所有16架飞机
void Drawback(int i,Chess plane,CDC *pdc);//绘出0状态的飞机,i代表每架飞机
//的编号,方便对号入座,可以用来画出被撞回去的飞机
int Roll();//随机返回一个1~6的整数,用来发挥骰子的作用
void Drawplane(Chess plane,CDC *pdc);//绘出处于1~4状态的飞机
int ischange; //纪录game_state用来判断flash的播放与停止
};
#ifndef _DEBUG // debug version in programView.cpp
inline CProgramDoc* CProgramView::GetDocument()
{ return (CProgramDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROGRAMVIEW_H__A3683800_B062_444D_A3E6_F47B9EE6C3B2__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -