📄 sequence.h
字号:
#ifndef GSEQUENCE_H
#define GSEQUENCE_H
#include <e32std.h>
#include <e32base.h>
namespace gamespace
{
/************************************************************************/
/* 序列类,保存一组索引值 */
/************************************************************************/
class CSequence
{
public:
CSequence();
void ConstructL(TInt* aPDatas,TInt aLen,TInt* aPDelays);
static CSequence* NewL(TInt* aPDatas,TInt aLen,TInt* aPDelays=NULL);
static CSequence* NewLC(TInt* aPDatas,TInt aLen,TInt* aPDelays=NULL);
~CSequence();
private:
TInt* iPDatas;
TInt iLen;
TInt iCurrentIndex;
TInt* iPDelays;//存储对应每一帧的延迟数,即调用几次NextFrame后才更换一下帧。默认值为1
TInt iElapse;//累计每一帧调用了几次NextFrame
public:
TBool iBLoop;
public:
void Set(TInt* aPDatas,TInt aLen,TInt* aPDelays=NULL);//设置序列
void Set(TInt aLen);//设置序列
bool NextFrame();//currentIndex增加,返回是否已越过最后一帧.(这里注意要先Draw,再调用Next)
void PrevFrame();//currentIndex减小
void SetCurrentIndex(TInt aSequenceIndex);//设置当前序列索引
TInt CurrentIndex();//得到当前序列索引
TInt CurrentFrame();//得到当前帧索引
TInt Length();//得到序列的长度
//重载类型转换操作符
operator TInt();//返回当前的帧索引
//重写赋值操作符
void operator=(CSequence* aSequence);
//重写拷贝构造函数
CSequence(CSequence& aSequence);
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -