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

📄 event.h

📁 以AIROBOT为平台构建的一个智能机器人。主源码见main.c。其余为使用的函数接口定义
💻 H
字号:
/*--------------------------------------------------------------------------
   	Event.h header file
----------------------------------------------------------------------------*/
//这个文件定义了存放具体事件信息的结构

#ifndef _Include_Event
#define _Include_Event

///////////////////////////////////////////////////////////////////////
struct ScannedRobotEvent
{
	long time;
	//被扫描到的机器人的名字
	const char * name;
	//被扫描到的机器人的坐标
	double x,y;
	//被扫描到的机器人的方向
	double heading;
	//被扫描到的机器人的速度
	double velocity;
	//被扫描到的机器人的能量
	double energy;
};

///////////////////////////////////////////////////////////////////////
struct BulletHitEvent
{
    long time;
	//击中敌人的炮弹的能量
	double power;
	//中弹敌人的X坐标
	double x;
	//中弹敌人的Y坐标
	double y;
	//中弹敌人的名字
	const char * name;
};

/////////////////////////////////////////////////////////////////////////
struct HitByBulletEvent
{
     long time;
	 //命中的子弹的能量
	 double power;
	 //发出这颗子弹的机器人的名字
     const char * name;
};

//////////////////////////////////////////////////////////////////////
struct HitRobotEvent
{
     long time;
	 //相撞的机器人的X坐标
	 double x;
	 //相撞的机器人的Y坐标
	 double y;
	 //相撞的机器人的名字
	 const char * name;
};

////////////////////////////////////////////////////////////////////////
struct RobotDeathEvent
{
     long time;
     const char* name;
};

/////////////////////////////////////////////////////////////////////////
struct HitWallEvent
{
   long time;
};

struct BeginEvent
{
   long time;
};

struct FinishEvent 
{
   long time;
};

struct OvertimeEvent
{
   long time;
};

/////////////////////////////////////////////////////////////////////////
#endif

⌨️ 快捷键说明

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