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

📄 kickcalculate.h

📁 RoboCup 2D 仿真组老牌强队Mersad 2005的完整源代码
💻 H
字号:
/* *  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: Ahmad Boorghany * *  Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. *  For more information please read README file.*/#ifndef __KICK_CALCULATE_H#define __KICK_CALCULATE_H#include <InterceptCalculate.h>#define KICK_DIR_STEP 5.00#define KICK_POW_STEP 20.0#define KICK_DIR_NUM (int)(360 / KICK_DIR_STEP)#define KICK_POW_NUM (int)(100 / KICK_POW_STEP)#define KICK_CALC_MAX_SEE_DELTA_CYCLE 5#define KICK_CALCULATES_EXTRA_NUM 3#define KICK_CALCULATES_NUM ((unsigned)(KICK_DIR_NUM * KICK_POW_NUM)\		 + KICK_CALCULATES_EXTRA_NUM)class WorldModel;class KickCommand;class KickInterceptPlayer{protected:	// Parent variables	bool extraCatchedFlag;	float dashDist;	unsigned interceptTime;	const Player *player;	Point interceptPoint;public:	void init(const InterceptPlayer &interPlayer);	// Getting functions	bool isExtraCatched() const;	float getDashDist() const;	unsigned getInterTime() const;	const Player &getPlayer() const;	const Point &getInterPoint() const;};class KickInterceptCalculate{protected:	// Parent variables	unsigned kickCycles;	unsigned fastestPlayerNum;	unsigned fastestTmmPlayerNum;	unsigned fastestOppPlayerNum;	unsigned checkedPlayersNum;	Ball firstBall;	Ball virtualBall;	PlayMode playMode;	KickInterceptPlayer checkedPlayers[MAX_CHECK_PLAYERS];	const Player *kickPlayer;	// Child variables	bool validFlag;	KickCommand *kickCommand;	// Information variables	float nearestOppToFastestDist;	float nearestOppToFastestDir;	unsigned passedOppPlayers;public:	KickInterceptCalculate();	virtual ~KickInterceptCalculate();	// Parent functions	bool existFastestPlayer() const;	bool existFastestTmmPlayer() const;	bool existFastestOppPlayer() const;	bool isFastestPlayer(const Player &player) const;	unsigned getTmmCheckedPlayersNum() const;	unsigned getOppCheckedPlayersNum() const;	unsigned getCheckedListNum(const Player &player) const;	const Player& getFastestPlayer() const;	const KickInterceptPlayer& getFastestInterPlayer() const;	const KickInterceptPlayer& getFastestTmmInterPlayer() const;	const KickInterceptPlayer& getFastestOppInterPlayer() const;	// Child functions	void saveResults(const InterceptCalculate &interCalc);	void init(const WorldModel *worldModel,			const KickCommand *kickCommandArg, InterceptCalculate &interCalc);	// Getting functions	bool isValid() const;	float getNearestOppToFastestDist() const;	float getNearestOppToFastestDir() const;	unsigned getKickCycles() const;	unsigned getFastestPlayerNum() const;	unsigned getFastestTmmPlayerNum() const;	unsigned getFastestOppPlayerNum() const;	unsigned getCheckedPlayersNum() const;	unsigned getPassedOppPlayers() const;	PlayMode getPlayMode() const;	const Ball &getFirstBall() const;	const Ball &getVirtualBall() const;	const Player *getKickPlayer() const;	const KickCommand &getKickCommand() const;	const KickInterceptPlayer &getCheckedInterPlayer(unsigned num) const;	// Setting functions	void setValid(bool validFlagArg);};class KickCalculate{protected:	bool validFlag;	bool initedFlag;	unsigned updateTime;	unsigned simulatesNum;	KickInterceptCalculate *simulates;public:	KickCalculate();	virtual ~KickCalculate();	void init();	void update(const WorldModel *worldModel);	void getNeighboursByDir(unsigned num,			unsigned &neighbour1, unsigned &neighbour2) const;	// Getting functions	bool isValid() const;	bool isInited() const;	unsigned getUpdateTime() const;	unsigned getSimulatesNum() const;	const KickInterceptCalculate &getSimulate(unsigned num) const;	// Setting functions	void setValid(bool validFlagArg);	void setInited(bool initedFlagArg);};#endif // __KICK_CALCULATE_H

⌨️ 快捷键说明

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