basicturn.h

来自「IRAN mesard_2d 2005源代码」· C头文件 代码 · 共 105 行

H
105
字号
/* *  Copyright 2002-2005, Mersad Team, Allameh 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. * *  This file is created by: Mohammad Salehe * *  Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. *  For more information please read README file.*/#ifndef __BASIC_TURN_H#define __BASIC_TURN_H#include <BasicAction.h>#ifndef NULL#	define NULL 0#endif // NULLclass Ball;class Player;class Body;class Object;class BasicTurn: public BasicAction{protected:	float deltaAngle;		float necessaryTurnAngle;	float requestedTargetAngle;	float performedTurnAngle;	float performedTurnMoment;	bool oneTurnPossible;	Command *turnCommand;public:	BasicTurn(ActionType creator);	virtual Command *getCommand() = 0;		float getDeltaAngle();		float getNecessaryTurnAngle();	float getRequestedTargetAngle();	float getPerformedTurnAngle();	float getPerformedTurnMoment();	bool isOneTurnPossible();	// static functions for public turn-related calculations	static float getTurnMoment(float angle, const Player &player);	static float getTurnAngle(float moment, const Player &player);	static int actionsToTurnAngle(float angle, const Player &player,			float maxDeltaAngle = 0);};class TurnAngle: public BasicTurn{protected:	public:	TurnAngle(ActionType creator, float angle, const Body &body, float maxDeltaAngle = 0);	virtual Command *getCommand();};class TurnToAngle: public BasicTurn{protected:	public:	TurnToAngle(ActionType creator, float angle, const Body &body, float maxDeltaAngle = 0);	virtual Command *getCommand();};class TurnToPoint: public BasicTurn{protected:	public:	TurnToPoint(ActionType creator, const Point &point, const Body &body, float maxDeltaAngle = 0);	virtual Command *getCommand();};class TurnToObject: public BasicTurn{protected:	public:	TurnToObject(ActionType creator, const Object &object, const Body &body, float maxDeltaAngle = 0);	virtual Command *getCommand();};#endif // __BASIC_TURN_H

⌨️ 快捷键说明

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