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

📄 soccertypes.h

📁 uva trilearn的robocup源程序
💻 H
📖 第 1 页 / 共 3 页
字号:
/*Copyright (c) 2000-2002, Jelle Kok, University of AmsterdamAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University of Amsterdam nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*//*! \file SoccerTypes.h<pre><b>File:</b>          SenseHandler.h<b>Project:</b>       Robocup Soccer Simulation Team: UvA Trilearn<b>Authors:</b>       Jelle Kok<b>Created:</b>       28/11/2000<b>Last Revision:</b> $ID$<b>Contents:</b>      This file contains the different enumerations and               constants that are important in the Soccer Server.               Furthermore it contains the class SoccerCommand which is               used to denote the different possible soccer commands and               the class SoccerTypes that contains all kind of static               methods to translate text strings that are received from               the server into the soccer types (=enumerations) that               are defined here. Finally it contains the Time class which               holds a two-tuple that represents the time in the soccer server.<hr size=2><h2><b>Changes</b></h2><b>Date</b>             <b>Author</b>          <b>Comment</b>28/11/2000       Jelle Kok       Initial version created</pre>*/#ifndef _SOCCERTYPES_#define _SOCCERTYPES_#include <iostream>     // needed for output stream.#include "Geometry.h"     // needed for AngDeg#include "ServerSettings.h"using namespace std;/******************************************************************************//********************** DEFINES ***********************************************//******************************************************************************/#define MAX_TEAMMATES          11       /*!< Maximum number of teammates      */#define MAX_OPPONENTS          11       /*!< Maximum number of opponents      */#define MAX_PLAYER_TYPES        8       /*!< Maximum number of player types                                                            (in formation!)   */#define MAX_FORMATION_TYPES     7       /*!< Maximum number of formations     */#define MAX_HETERO_PLAYERS      7       /*!< Maximum number of hetero players */#define MAX_COMMANDS           10       /*!< nr of commands that can be stored*/#define MAX_MSG              3052       /*!< maximum message size from server */#define MAX_SAY_MSG            10       /*!< maximum size of say message      */#define MAX_TEAM_NAME_LENGTH   64       /*!< maximum length of teamname       */#define MAX_FLAGS              55       /*!< maximum number of flags on field */#define MAX_LINES               4       /*!< maximum number of lines on field */#define DEFAULT_TEAM_NAME     "Team_L"  /*!< default teamname for own team    */#define DEFAULT_OPPONENT_NAME "Team_R"  /*!< default teamname for opponent    */#define PITCH_LENGTH        105.0       /*!< length of the pitch              */#define PITCH_WIDTH          68.0       /*!< width  of the pitch              */#define PITCH_MARGIN          5.0       /*!< margin next to the pitch         */#define PENALTY_AREA_LENGTH  16.5       /*!< length of the penalty area       */#define PENALTY_AREA_WIDTH   40.32      /*!< width of the penalty area        */#define PENALTY_X (PITCH_LENGTH/2.0-PENALTY_AREA_LENGTH) /*!< penalty line of                                             the opponent team                *//******************************************************************************//********************** CONSTANTS *********************************************//******************************************************************************/const double  UnknownDoubleValue  = -1000.0; /*!< indicates unknown double    */const AngDeg  UnknownAngleValue   = -1000.0; /*!< indicates unknown angle     */const int     UnknownIntValue     = -1000;   /*!< indicates unknown int       */const int     UnknownTime         = -20;     /*!< indicates unknown time      */const long    UnknownMessageNr    = -30;     /*!< indicates unknown message nr*//******************************************************************************//********************** ENUMERATIONS ******************************************//******************************************************************************//*! ObjectT is an enumeration of all possible objects that are part of the    RoboCup soccer simulation. The class SoccerTypes contains different methods    to easily work with these objects and convert them to text strings and text    strings to ObjectT. */enum ObjectT { // don't change order  OBJECT_BALL,             /*!< Ball                     */  OBJECT_GOAL_L,           /*!< Left goal                */    // 2 goals  OBJECT_GOAL_R,           /*!< Right goal               */  OBJECT_GOAL_UNKNOWN,     /*!< Unknown goal             */  OBJECT_LINE_L,           /*!< Left line                */    // 4 lines  OBJECT_LINE_R,           /*!< Right line               */  OBJECT_LINE_B,           /*!< Bottom line              */  OBJECT_LINE_T,           /*!< Top line                 */  OBJECT_FLAG_L_T,         /*!< Flag left top            */   // 53 flags  OBJECT_FLAG_T_L_50,      /*!< Flag top left 50         */  OBJECT_FLAG_T_L_40,      /*!< Flag top left 40         */  OBJECT_FLAG_T_L_30,      /*!< Flag top left 30         */  OBJECT_FLAG_T_L_20,      /*!< Flag top left 20         */  OBJECT_FLAG_T_L_10,      /*!< Flag top left 10         */  OBJECT_FLAG_T_0,         /*!< Flag top left 0          */  OBJECT_FLAG_C_T,         /*!< Flag top center          */  OBJECT_FLAG_T_R_10,      /*!< Flag top right 10        */  OBJECT_FLAG_T_R_20,      /*!< Flag top right 20        */  OBJECT_FLAG_T_R_30,      /*!< Flag top right 30        */  OBJECT_FLAG_T_R_40,      /*!< Flag top right 40        */  OBJECT_FLAG_T_R_50,      /*!< Flag top right 50        */  OBJECT_FLAG_R_T,         /*!< Flag right top           */  OBJECT_FLAG_R_T_30,      /*!< Flag right top 30        */  OBJECT_FLAG_R_T_20,      /*!< Flag right top 20        */  OBJECT_FLAG_R_T_10,      /*!< Flag right top 10        */  OBJECT_FLAG_G_R_T,       /*!< Flag goal right top      */  OBJECT_FLAG_R_0,         /*!< Flag right 0             */  OBJECT_FLAG_G_R_B,       /*!< Flag goal right bottom   */  OBJECT_FLAG_R_B_10,      /*!< Flag right bottom 10     */  OBJECT_FLAG_R_B_20,      /*!< Flag right bottom 20     */  OBJECT_FLAG_R_B_30,      /*!< Flag right bottom 30     */  OBJECT_FLAG_R_B,         /*!< Flag right bottom        */  OBJECT_FLAG_B_R_50,      /*!< Flag bottom right 50     */  OBJECT_FLAG_B_R_40,      /*!< Flag bottom right 40     */  OBJECT_FLAG_B_R_30,      /*!< Flag bottom right 30     */  OBJECT_FLAG_B_R_20,      /*!< Flag bottom right 20     */  OBJECT_FLAG_B_R_10,      /*!< Flag bottom right 10     */  OBJECT_FLAG_C_B,         /*!< Flag center bottom       */  OBJECT_FLAG_B_0,         /*!< Flag bottom 0            */  OBJECT_FLAG_B_L_10,      /*!< Flag bottom left 10      */  OBJECT_FLAG_B_L_20,      /*!< Flag bottom left 20      */  OBJECT_FLAG_B_L_30,      /*!< Flag bottom left 30      */  OBJECT_FLAG_B_L_40,      /*!< Flag bottom left 40      */  OBJECT_FLAG_B_L_50,      /*!< Flag bottom left 50      */  OBJECT_FLAG_L_B,         /*!< Flag left bottom         */  OBJECT_FLAG_L_B_30,      /*!< Flag left bottom 30      */  OBJECT_FLAG_L_B_20,      /*!< Flag left bottom 20      */  OBJECT_FLAG_L_B_10,      /*!< Flag left bottom 10      */  OBJECT_FLAG_G_L_B,       /*!< Flag goal left bottom    */  OBJECT_FLAG_L_0,         /*!< Flag left 0              */  OBJECT_FLAG_G_L_T,       /*!< Flag goal left top       */  OBJECT_FLAG_L_T_10,      /*!< Flag left bottom 10      */  OBJECT_FLAG_L_T_20,      /*!< Flag left bottom 20      */  OBJECT_FLAG_L_T_30,      /*!< Flag left bottom 30      */  OBJECT_FLAG_P_L_T,       /*!< Flag penaly left top     */  OBJECT_FLAG_P_L_C,       /*!< Flag penaly left center  */  OBJECT_FLAG_P_L_B,       /*!< Flag penaly left bottom  */  OBJECT_FLAG_P_R_T,       /*!< Flag penaly right top    */  OBJECT_FLAG_P_R_C,       /*!< Flag penaly right center */  OBJECT_FLAG_P_R_B,       /*!< Flag penaly right bottom */  OBJECT_FLAG_C,           /*!< Flag center field        */  OBJECT_TEAMMATE_1,       /*!< Teammate nr 1            */    // teammates 61  OBJECT_TEAMMATE_2,       /*!< Teammate nr 2            */  OBJECT_TEAMMATE_3,       /*!< Teammate nr 3            */  OBJECT_TEAMMATE_4,       /*!< Teammate nr 4            */  OBJECT_TEAMMATE_5,       /*!< Teammate nr 5            */  OBJECT_TEAMMATE_6,       /*!< Teammate nr 6            */  OBJECT_TEAMMATE_7,       /*!< Teammate nr 7            */  OBJECT_TEAMMATE_8,       /*!< Teammate nr 8            */  OBJECT_TEAMMATE_9,       /*!< Teammate nr 9            */  OBJECT_TEAMMATE_10,      /*!< Teammate nr 10           */  OBJECT_TEAMMATE_11,      /*!< Teammate nr 11           */  OBJECT_TEAMMATE_UNKNOWN, /*!< Teammate nr unkown       */  OBJECT_OPPONENT_1,       /*!< Opponent nr 1            */    // opponents 73  OBJECT_OPPONENT_2,       /*!< Opponent nr 2            */  OBJECT_OPPONENT_3,       /*!< Opponent nr 3            */  OBJECT_OPPONENT_4,       /*!< Opponent nr 4            */  OBJECT_OPPONENT_5,       /*!< Opponent nr 5            */  OBJECT_OPPONENT_6,       /*!< Opponent nr 6            */  OBJECT_OPPONENT_7,       /*!< Opponent nr 7            */  OBJECT_OPPONENT_8,       /*!< Opponent nr 8            */  OBJECT_OPPONENT_9,       /*!< Opponent nr 9            */  OBJECT_OPPONENT_10,      /*!< Opponent nr 10           */  OBJECT_OPPONENT_11,      /*!< Opponent nr 11           */  OBJECT_OPPONENT_UNKNOWN, /*!< Opponent nr unknown      */  OBJECT_PLAYER_UNKNOWN,   /*!< Unknown player           */  OBJECT_UNKNOWN,          /*!< Unknown object           */  OBJECT_TEAMMATE_GOALIE,  /*!< Goalie of your side      */  OBJECT_OPPONENT_GOALIE,  /*!< Goalie of opponent side  */  OBJECT_ILLEGAL,          /*!< illegal object           */  OBJECT_MAX_OBJECTS       /*!< maximum nr of objects    */ // 90} ;/*!The ObjectSetT enumerations holds the different object sets, which   consists of one or multiple ObjectT types. */enum ObjectSetT{  OBJECT_SET_TEAMMATES,  /*!< teammates */  OBJECT_SET_OPPONENTS,  /*!< opponents */

⌨️ 快捷键说明

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