Hero.h
上传用户:pfmy85
上传日期:2007-01-07
资源大小:22k
文件大小:1k
- // Hero.h: interface for the CHero class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_HERO_H__00555C84_3B90_11D3_9B59_0080C8E05391__INCLUDED_)
- #define AFX_HERO_H__00555C84_3B90_11D3_9B59_0080C8E05391__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "IsoType.h"
- #include "PackFile.h"
- class CHero
- {
- public:
- CHero();
- virtual ~CHero();
- public:
- enum HERO_ACTION
- {
- ACTION_HT=0,
- ACTION_ST,
- ACTION_WL,
- ACTION_FM,
- ACTION_LM,
- ACTION_QM,
- ACTION_AS,
- ACTION_AT,
- ACTION_AW,
- ACTION_CNT
- };
- static const char* m_szHeroAction[ACTION_CNT];
- POINT m_ptSpriteSize[ACTION_CNT];
- public:
- bool Create(CDDDevice* pDDDevice,
- LPCTSTR lpszName,
- POINT* pSize,
- CPackFileManager* pPackFileManager=NULL);
- void SetViewRect(LPRECT lprcView);
- void Draw(CDDSurface* pDestSurface, LPRECT pRect = NULL);
- void ServeIt(__int64 nTime);
- bool SetAction(CHero::HERO_ACTION eAction);
- bool SetDirection(DIRECTION eDir);
- void SetPos(int x, int y);
- void Move(CDXIsoMap* pMap, DIRECTION eDir);
- HERO_ACTION m_eAction; // 当前动作
- DIRECTION m_eDirection; // 当前方向
- CDXSprite* m_pAction[ACTION_CNT];
- int m_nFrames[ACTION_CNT]; // 各动作单方向的帧数
- int m_nCurFrame; // 当前动作的帧数计数
- int m_nPosX; // 底部中点的相对位置
- int m_nPosY; // 相对于地图视窗
- RECT m_rcView;
- };
- #endif // !defined(AFX_HERO_H__00555C84_3B90_11D3_9B59_0080C8E05391__INCLUDED_)