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

📄 shoot.h

📁 RoboCup仿真组世界冠军源代码
💻 H
字号:
/*
    Copyright (C) 2001  Tsinghuaeolus

    Authors : ChenJiang, YaoJinyi, CaiYunpeng, Lishi

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library 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
    Lesser General Public License for more details.

	If you make any changes or have any comments we would appreciate a 
	message to yjy01@mails.tsinghua.edu.cn.
*/

#ifndef _shoot
#define _shoot
#include "bpn.h"
#include "types.h"
#include "Command.h"
#include "Strategy.h"
#include "goingthroughspeed.h"

class ShootInfo{
public:
	float shootangle;
	float min_shootspeed;
	float check_shootspeed;
	float prob_postfail;
	float prob_goaliefail;
	float ShootAngle(){ return shootangle; }
	float MinShootSpeed(){ return min_shootspeed; }
	ShootInfo(){shootangle = 0; min_shootspeed = CP_impossible_speed;}
};

class Shoot : public GT_speed_utils{
private:
	ShootInfo shootinfo[CP_max_shootinfos];
	int num_shootinfo;

	Vector ballpos;
	Vector goaliepos;
	bool goalie_exist;
	Vector Opp_relpos[SP_team_size * 2];
	int num_consider_opp;
	float spreadangle;

	float leftangle;
	float rightangle;
	bool reverse;

	Vector checkpos[CP_max_checkshoot];
	int num_checkpos;

	void AddShootInfo(float min_shootspeed, float shootangle, float goaliefail);
	inline float Getprob_post(float tolerance);
	bool GetShootInfo(float shoot_angle);
public:
	bool GetShootInfo();
	bool SmartShoot();
	KT_Res shoot(ShootInfo& shootinf, Command& command);

	void Initballpos(Vector pos, bool Reverse = false);
	Vector Supposegoalie(Vector pos, float radius);

	inline void Setgoaliepos(Vector relpos);
	void Setgoalieradius(float radius);
	inline void Addopponent(Vector relpos);

	bool GetBestShoot(ShootInfo& info);
	inline float GetShootWidth(){return spreadangle;}

	float GuessShoot(Vector pos, int cycles);
	friend class Handleball;
};

#endif

⌨️ 快捷键说明

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