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

📄 object.h

📁 mersad源码 03年robocup 季军 可以研究一下大家
💻 H
字号:
/* *  Copyright 2002-2004, Mersad Team, Allame Helli High School (NODET). * *  This program is free software, you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *  GNU Library General Public License for more details. * *  Created by: Ahmad Boorghany *  Released on Friday 1 April 2005 by Mersad RoboCup Team. *  For more information please read README file.*/#ifndef __OBJECT_H#define __OBJECT_H#include <Vector.h>#include <FieldData.h>#ifndef NULL#	define NULL 0#endif // NULL#define MAX_POS_DEV 20#define MAX_VEL_DEV 5class ConfigGroup;class SExpression;typedef ConfigGroup Param;class Object{protected:	bool readyToUpdateFlag;	float posDeviation;	float validPosDeviation;	float velDeviation;	float seeDistance;	float seeDirection;	float seeDistChange;	float seeDirChange;	unsigned seeTime;	unsigned velSeeTime;	Vector position;	Vector velocity;	Vector absVector;	Vector bodyVector;	Vector headVector;	// Local serverparams for Updates and Simulates	float accelMax;	float decay;	float rand;	float size;	float speedMax;	float maxMoment;	float minMoment;	float maxPower;	float minPower;	float quantizeStep;	float quantizeStepL;public:	Object();	virtual ~Object();	void setServerParamVars(const Param &serverParam);	void parse(const SExpression &exp, unsigned curTime);	float getDistance(const Object &obj) const;	float getDistance(const Point &point) const;	void kill();	bool isValid() const;	// Getting functions	bool isReadyToUpdate() const;	float getPosDeviation() const;	float getValidPosDeviation() const;	float getVelDeviation() const;	float getSeeDistance() const;	float getSeeDirection() const;	float getSeeDistChange() const;	float getSeeDirChange() const;	unsigned getSeeTime() const;	unsigned getVelSeeTime() const;	float getAccelMax() const;	float getDecay() const;	float getRand() const;	float getSize() const;	float getSpeedMax() const;	float getMaxMoment() const;	float getMinMoment() const;	float getMaxPower() const;	float getMinPower() const;	float getQuantizeStep() const;	float getQuantizeStepL() const;	const Vector &getPos() const;	const Vector &getVel() const;	const Vector &getAbsVec() const;	const Vector &getBodyVec() const;	const Vector &getHeadVec() const;	// Setting functions	void setReadyToUpdate(bool readyToUpdateFlagArg);	void setPosDeviation(float posDeviationArg);	void setValidPosDeviation(float posDeviationArg);	void setVelDeviation(float velDeviationArg);	void setSeeDistance(float seeDistanceArg);	void setSeeDirection(float seeDirectionArg);	void setSeeDistChange(float seeDistChangeArg);	void setSeeDirChange(float seeDirChangeArg);	void setSeeTime(unsigned seeTimeArg);	void setVelSeeTime(unsigned velSeeTimeArg);	void setDecay(float decayArg);	Vector &setPos();	Vector &setVel();	Vector &setAbsVec();	Vector &setBodyVec();	Vector &setHeadVec();};class FieldFlag: public Object{protected:	int id;public:	void update(const FieldData &fieldData);	void parse(int idArg, const SExpression &exp, unsigned curTime);	int getId() const;};class FieldLine: public Object{protected:	int id;	float prependOrient;public:	void update(const FieldData &fieldData);	void parse(int idArg, const SExpression &exp, unsigned curTime);	int getId() const;	float getPrependOrient() const;};class FieldGoal: public Object{protected:	int id;public:	void update(const FieldData &fieldData);	void parse(int idArg, const SExpression &exp, unsigned curTime);	void parseFullState(int idArg, const SExpression &exp, unsigned curTime);	int getId() const;};#endif // __OBJECT_H

⌨️ 快捷键说明

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