📄 colorlinezuitwomodel.h
字号:
/*
============================================================================
Name : ColorLinezUITwoModel.h
Author :
Version : 1.0
Copyright :
Description : CColorLinezUITwoModel declaration
============================================================================
*/
#ifndef COLORLINEZUITWOMODEL_H
#define COLORLINEZUITWOMODEL_H
// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <fbs.h>
// CLASS DECLARATION
/**
* note the information of current position
*/
class TCurrentInfo
{
public:
TPoint iCurrentPos;
CFbsBitmap* iCurrentBitmap;
};
/**
* CColorLinezUITwoModel
*
*/
class CColorLinezUITwoModel : public CBase
{
public:
// Constructors and destructor
/**
* Destructor.
*/
~CColorLinezUITwoModel();
/**
* Two-phased constructor.
*/
static CColorLinezUITwoModel* NewL();
/**
* Two-phased constructor.
*/
static CColorLinezUITwoModel* NewLC();
void SetCurrentBitmap(TPoint aCurrentPos,CFbsBitmap* aCurrentBitmap);
CFbsBitmap* GetCurrentBitmap(TPoint aCurrentPos);
TPoint GetCurrentBitmapByBmp(CFbsBitmap* aCurrentBitmap);
static TBool Match(const TCurrentInfo& aFirstInfo,const TCurrentInfo& aSecondInfo);
//编写记录分数的方法
void SetScore(TInt aScore);
TInt GetScore();
TBool Test();//测试是否完成了搜索
TBool ActOK();//判断移动方向是否合理
void Back();//后退一步,将坐标置为前一步
short GetNextAct();//寻找下一步的方向
TBool FindPath(short aLevelX,short aLevelY,short aTargetX,short aTargetY);
// void SetTable(short aLevelX,short aLevelY);//设置路过坐标为真
void SetBlock(short aLevelX,short aLevelY);//设置路过坐标为真
void RemoveBlock(short aLevelX,short aLevelY);//移除障碍
// TBool iBlock[7][7];//障碍矩阵
// TBool iTable[7][7];//路过的方格的标记
private:
// TPoint iCurrentPos;
// CFbsBitmap* iCurrentBitmap;
RArray<TCurrentInfo> iCurrentInfos;
TInt iScore;
TBool iBlock[7][7];//障碍矩阵
TBool iTable[7][7];//路过的方格的标记
TBool iLevelComplete;//判断当前这一步的搜索是否完成
TBool iAllComplete;//判断所有搜索是否完成
short iDX[4];//{-1,0,1,0}
short iDY[4];//{0,-1,0,1}
short iMaxAct;//记录最大方向是4
short iLevel;//记录步骤,一共走了几步
short iLevelX;
short iLevelY;//记录当前的坐标
short iTargetX;
short iTargetY;//目标位置的坐标
short dis[4];//记录四个方向到达目标的距离,仅以坐标表示
short order[4];
short t;
short tt;
short disX;
short disY;
TBool isComplete;
short Act[50];//记录每一步的移动方向
private:
/**
* Constructor for performing 1st stage construction
*/
CColorLinezUITwoModel();
/**
* EPOC default constructor for performing 2nd stage construction
*/
void ConstructL();
};
#endif // COLORLINEZUITWOMODEL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -