helper.h

来自「用VC在BREW平台上开发的手机游戏Superball的源代码」· C头文件 代码 · 共 86 行

H
86
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?