📄 hetroplayer.h
字号:
/* -*- Mode: C++ -*- *//* *Copyright: Copyright (C) 1996-2000 Electrotechnical Laboratory. Itsuki Noda, Yasuo Kuniyoshi and Hitoshi Matsubara. Copyright (C) 2000, 2001 RoboCup Soccer Server Maintainance Group. Patrick Riley, Tom Howard, Daniel Polani, Itsuki Noda, Mikhail Prokopenko, Jan Wendler This file is a part of SoccerServer. This code 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. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *EndCopyright: */#ifndef _HETROPLAYER_H_#define _HETROPLAYER_H_#include "param.h"#include "types.h"#include <cstdlib>#include <sys/time.h>#include "serverparam.h"#include "playerparam.h"#include <iostream>class HetroPlayer{public: HetroPlayer(); HetroPlayer( int ); ~HetroPlayer(); Value playerSpeedMax () const { return player_speed_max; } Value staminaIncMax () const { return stamina_inc_max; } Value playerDecay () const { return player_decay; } Value inertiaMoment () const { return inertia_moment; } Value dashPowerRate () const { return dash_power_rate; } Value playerSize () const { return player_size; } Value kickableMargin () const { return kickable_margin; } Value kickRand () const { return kick_rand; } Value extraStamina () const { return extra_stamina; } Value effortMax () const { return effort_max; } Value effortMin () const { return effort_min; } friend std::ostream& operator<< ( std::ostream& o, const HetroPlayer& hp ); player_type_t convertToStruct ( int id ); private: static Value delta ( Value min, Value max ); static void seed (); static bool seeded; Value player_speed_max; Value stamina_inc_max; Value player_decay; Value inertia_moment; Value dash_power_rate; Value player_size; Value kickable_margin; Value kick_rand; Value extra_stamina; Value effort_max; Value effort_min;};class PlayerTypeSensor{};class PlayerTypeSensor_v7 : public PlayerTypeSensor{public: struct data_t { int M_id; double M_player_speed_max; double M_stamina_inc_max; double M_player_decay; double M_inertia_moment; double M_dash_power_rate; double M_player_size; double M_kickable_margin; double M_kick_rand; double M_extra_stamina; double M_effort_max; double M_effort_min; data_t ( const int& id, const HetroPlayer& hp ) : M_id ( id ), M_player_speed_max ( hp.playerSpeedMax () ), M_stamina_inc_max ( hp.staminaIncMax () ), M_player_decay ( hp.playerDecay () ), M_inertia_moment ( hp.inertiaMoment () ), M_dash_power_rate ( hp.dashPowerRate () ), M_player_size ( hp.playerSize () ), M_kickable_margin ( hp.kickableMargin () ), M_kick_rand ( hp.kickRand () ), M_extra_stamina ( hp.extraStamina () ), M_effort_max ( hp.effortMax () ), M_effort_min ( hp.effortMin () ) { } }; virtual void send ( const PlayerTypeSensor_v7::data_t& data ) = 0;};std::ostream& toStr ( std::ostream& o, const PlayerTypeSensor_v7::data_t& data );class PlayerTypeSensor_v8 : public PlayerTypeSensor_v7{public: struct data_t : public PlayerTypeSensor_v7::data_t { data_t ( const int& id, const HetroPlayer& hp ) : PlayerTypeSensor_v7::data_t ( id, hp ) { } }; virtual void send ( const PlayerTypeSensor_v8::data_t& data ) = 0;};std::ostream& toStr ( std::ostream& o, const PlayerTypeSensor_v8::data_t& data );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -