📄 types.h
字号:
/*
*Header:
*File: typedefs.h
*Author: Noda Itsuki
*Date: 1995/02/24
*EndHeader:
*/
/*
*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 _TYPES_H_
#define _TYPES_H_
#include "param.h"
/*
*ModifyHistory
*
*EndModifyHistory
*/
typedef double Value ;
typedef int ID ;
typedef int TheNumber ;
typedef char* Name ;
typedef int Logical ;
#define NULLCHAR '\000'
#define SOCKLEN_T size_t
/*
class Angle : public double {} ;
*/
typedef double Angle ;
#define TRUE 1
#define FALSE 0
#define True 1
#define False 0
#define DISABLE 0x0000
#define STAND 0x0001
#define KICK 0x0002
#define KICK_FAULT 0x0004
#define GOALIE 0x0008
#define GOALIE_CATCH 0x0010
#define CATCH_FAULT 0x0020
#define BALL_TO_PLAYER 0x0040
#define PLAYER_TO_BALL 0x0080
#define DISCARD 0x0100
// [I.Noda:00/05/13] added for 3D viewer/commentator/small league
#define LOST 0x0200
#define BALL_COLLIDE 0x0400 // player collided with the ball
#define PLAYER_COLLIDE 0x0800 // player collided with another player
#define TACKLE 0x1000
#define TACKLE_FAULT 0x2000
#define BACK_PASS 0x4000
#define FREE_KICK_FAULT 0x8000
typedef int Side ;
#define LEFT 1
#define NEUTRAL 0
#define RIGHT -1
#define PLAYMODE_STRINGS {"",\
"before_kick_off",\
"time_over",\
"play_on",\
"kick_off_l",\
"kick_off_r",\
"kick_in_l",\
"kick_in_r",\
"free_kick_l",\
"free_kick_r",\
"corner_kick_l",\
"corner_kick_r",\
"goal_kick_l",\
"goal_kick_r",\
"goal_l",\
"goal_r",\
"drop_ball",\
"offside_l",\
"offside_r",\
"penalty_kick_l",\
"penalty_kick_r",\
"first_half_over",\
"pause",\
"human_judge",\
"foul_charge_l",\
"foul_charge_r",\
"foul_push_l",\
"foul_push_r",\
"foul_multiple_attack_l",\
"foul_multiple_attack_r",\
"foul_ballout_l",\
"foul_ballout_r",\
"back_pass_l", \
"back_pass_r", \
"free_kick_fault_l", \
"free_kick_fault_r", \
"catch_fault_l", \
"cacth_fault_r", \
"indirect_free_kick_l", \
"indirect_free_kick_r",\
"penalty_setup_l", \
"penalty_setup_r",\
"penalty_ready_l",\
"penalty_ready_r", \
"penalty_taken_l", \
"penalty_taken_r", \
"penalty_miss_l", \
"penalty_miss_r", \
"penalty_score_l", \
"penalty_score_r" \
}
typedef enum _PlayMode {
PM_Null,
PM_BeforeKickOff,
PM_TimeOver,
PM_PlayOn,
PM_KickOff_Left,
PM_KickOff_Right,
PM_KickIn_Left,
PM_KickIn_Right,
PM_FreeKick_Left,
PM_FreeKick_Right,
PM_CornerKick_Left,
PM_CornerKick_Right,
PM_GoalKick_Left,
PM_GoalKick_Right,
PM_AfterGoal_Left,
PM_AfterGoal_Right,
PM_Drop_Ball,
PM_OffSide_Left,
PM_OffSide_Right,
// [I.Noda:00/05/13] added for 3D viewer/commentator/small league
PM_PK_Left,
PM_PK_Right,
PM_FirstHalfOver,
PM_Pause,
PM_Human,
PM_Foul_Charge_Left,
PM_Foul_Charge_Right,
PM_Foul_Push_Left,
PM_Foul_Push_Right,
PM_Foul_MultipleAttacker_Left,
PM_Foul_MultipleAttacker_Right,
PM_Foul_BallOut_Left,
PM_Foul_BallOut_Right,
PM_Back_Pass_Left,
PM_Back_Pass_Right,
PM_Free_Kick_Fault_Left,
PM_Free_Kick_Fault_Right,
PM_CatchFault_Left,
PM_CatchFault_Right,
PM_IndFreeKick_Left,
PM_IndFreeKick_Right,
PM_PenaltySetup_Left,
PM_PenaltySetup_Right,
PM_PenaltyReady_Left,
PM_PenaltyReady_Right,
PM_PenaltyTaken_Left,
PM_PenaltyTaken_Right,
PM_PenaltyMiss_Left,
PM_PenaltyMiss_Right,
PM_PenaltyScore_Left,
PM_PenaltyScore_Right,
PM_MAX
} PlayMode ;
typedef enum _PlayerTypes {
PT_Null,
PT_default,
PT_Hetro_A,
PT_Hetro_B,
PT_Hetro_C,
PT_Hetro_D,
PT_Hetro_E,
PT_Hetro_F
} PlayerTypes;
typedef enum _MPObjectType {
MPO_Ball,
MPO_Player
} MPObjectType ;
#define Zero 0.0e0
#define COLOR_NAME_MAX 64
typedef struct {
short enable ;
short side ;
short unum ;
short angle ;
short x ;
short y ;
} pos_t ;
typedef struct {
char name[16] ;
short score ;
} team_t ;
typedef struct {
char pmode ;
team_t team[2] ;
pos_t pos[MAX_PLAYER * 2 + 1] ;
short time ;
} showinfo_t ;
const int max_message_length_for_display = 2048;
typedef struct {
short board ;
char message[max_message_length_for_display] ;
} msginfo_t ;
typedef struct {
short x ;
short y ;
char color[COLOR_NAME_MAX] ;
} pointinfo_t ;
typedef struct {
short x ;
short y ;
short r ;
char color[COLOR_NAME_MAX] ;
} circleinfo_t ;
typedef struct {
short x1 ;
short y1 ;
short x2 ;
short y2 ;
char color[COLOR_NAME_MAX] ;
} lineinfo_t ;
typedef struct {
short mode ;
union {
pointinfo_t pinfo ;
circleinfo_t cinfo ;
lineinfo_t linfo ;
} object ;
} drawinfo_t ;
typedef struct {
short mode ;
union {
showinfo_t show ;
msginfo_t msg ;
drawinfo_t draw ;
} body ;
} dispinfo_t ;
typedef struct displist {
unsigned long shost ;
int sport ;
int version ;
struct displist *next ;
} displist_t ;
typedef struct {
char optname[32] ;
void *vptr ;
int vsize ;
} option_t ;
#define VAL_INT 1
#define VAL_DOUBLE 2
#define VAL_BOOL 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -