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

📄 helper.h

📁 用VC在BREW平台上开发的手机游戏Superball的源代码
💻 H
字号:
// helper.h: interface for the PtrList class.
//
//////////////////////////////////////////////////////////////////////
#ifndef _BEL_HELPER_H_
#define _BEL_HELPER_H_


#include "BEL.h"
#include "AEE.h"
#include "AEEAppGen.h"

class ListNode:public BREWObj
{
public:
	void*     ptr; 
	ListNode* prev; 
	ListNode* next; 
};

class PtrList:public BREWObj  
{
public:
	PtrList();
	virtual ~PtrList();

protected:	
	ListNode*    head;
	ListNode*	 now;
	ListNode*    tail;
	uint8        num;

public:
	boolean   AddElement(void* element);
	void*     GetHeadElement(); 
	void*     GetNextElement(void* element); 
	ListNode* FindElement(void* element); 
	void      Remove(void* element); 
	uint8     GetEleNumber();
	void      Clear();
	//------------------add by liudibo-------------------
	void	  SwapElement(void* element1, void* element2);
	void*	  GetAtElement();
	void*	  GetTailElement();
	void*	  GetPrevElement(void* element);
	boolean	  InsertElement(void* element, uint8 pos);
	//------------------add by liudibo-------------------
};

class StopWatch : public BREWObj
{
public:
	StopWatch(uint8 id, boolean send = TRUE);
	virtual ~StopWatch();

	void		Start();
	void		Stop();
	void		Enable();
	void		Disable();
	void		Set(uint16 total, uint16 dur = 1000);
	
	boolean		IsRunning();

protected:
	static void	StopWatchCB(void* pUser);
	
protected:
	AEEApplet*  pApp;
	uint16		duration;
	uint16		totalStep;
	uint16		curStep;
	boolean		isRunning;
	boolean		isSend;
	uint8		id;
};


#define Cos(a)              (Sin((a) + 90))
double Sine(uint16 angle);
double Cosine(uint16 angle);
double Tangent(uint16 angle);
int16  Sin(int16 angle);

int  DoubleToInt(double dVal,int32 incVal);

#endif 

⌨️ 快捷键说明

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