00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00048 #ifndef _BASICPLAYER_
00049 #define _BASICPLAYER_
00050
00051 #include "ActHandler.h"
00052
00053 #include "fuzzyobj.h"
00054
00055 extern Logger Log;
00061 class BasicPlayer
00062 {
00063 protected:
00064 ActHandler *ACT;
00065 WorldModel *WM;
00066 ServerSettings *SS;
00067 PlayerSettings *PS;
00069
00070
00071 SoccerCommand alignNeckWithBody ( );
00072 SoccerCommand turnBodyToPoint ( VecPosition pos,
00073 int iPos = 1 );
00074 SoccerCommand turnBackToPoint ( VecPosition pos,
00075 int iPos = 1 );
00076 SoccerCommand turnNeckToPoint ( VecPosition pos,
00077 SoccerCommand com );
00078 SoccerCommand searchBall ( );
00079 SoccerCommand dashToPoint ( VecPosition pos,
00080 int iCycles = 1 );
00081 SoccerCommand freezeBall ( );
00082 SoccerCommand kickBallCloseToBody ( AngDeg ang,
00083 double dKickRatio = 0.16 );
00084 SoccerCommand accelerateBallToVelocity( VecPosition vel );
00085 SoccerCommand catchBall ( );
00086 SoccerCommand communicate ( char *str );
00087 SoccerCommand teleportToPos ( VecPosition pos );
00088 SoccerCommand listenTo ( ObjectT obj );
00089 SoccerCommand tackle ( );
00090 SoccerCommand adjustView ( double distance,
00091 double min = 1,
00092 double max = 20 );
00093 SoccerCommand turnAround ( );
00094 void oscillateView ( SoccerCommand soc );
00095
00097
00098 SoccerCommand turnBodyToObject ( ObjectT o );
00099 SoccerCommand turnNeckToObject ( ObjectT o,
00100 SoccerCommand com );
00101 SoccerCommand directTowards ( VecPosition posTo,
00102 AngDeg angWhenToTurn,
00103 VecPosition *pos = NULL,
00104 VecPosition *vel = NULL,
00105 AngDeg *angBody = NULL );
00106 SoccerCommand moveToPos ( VecPosition posTo,
00107 AngDeg angWhenToTurn,
00108 double dDistDashBack = 0.0,
00109 bool bMoveBack = false,
00110 int iCycles = 1 );
00111 SoccerCommand collideWithBall ( );
00112 SoccerCommand interceptClose ( );
00113 SoccerCommand interceptCloseGoalie ( );
00114 SoccerCommand kickTo ( VecPosition posTarget,
00115 double dEndSpeed );
00116 SoccerCommand turnWithBallTo ( AngDeg ang,
00117 AngDeg angKickThr,
00118 double dFreezeThr );
00119 SoccerCommand moveToPosAlongLine ( VecPosition pos,
00120 AngDeg ang,
00121 double dDistThr,
00122 int iSign,
00123 AngDeg angThr,
00124 AngDeg angCorr );
00125
00126 int canDribbleFast ( );
00127 int canDribbleSlow ( );
00128 int canDribbleWithBall ( );
00129 SoccerCommand dribbleFast ( int dDirection );
00130 SoccerCommand dribbleSlow ( int dDirection );
00131 SoccerCommand dribbleWithBall ( int dDirection );
00132 int getNrOfBarrierInCone ( int iType,
00133 double dR );
00134 bool isFreeCone ( double angle,
00135 double length );
00136
00138
00139 SoccerCommand intercept ( bool isGoalie );
00140 SoccerCommand dribble ( AngDeg ang,
00141 DribbleT d );
00142 SoccerCommand handleWithBall ( );
00143 SoccerCommand directPass ( VecPosition pos,
00144 PassT passType );
00145 SoccerCommand leadingPass ( ObjectT o,
00146 double dDist,
00147 DirectionT dir = DIR_NORTH );
00148 SoccerCommand throughPass ( ObjectT o,
00149 VecPosition posEnd,
00150 AngDeg *angMax = NULL );
00151 SoccerCommand outplayOpponent ( ObjectT o,
00152 VecPosition pos,
00153 VecPosition *posTo = NULL );
00154 SoccerCommand clearBall ( ClearBallT type,
00155 SideT s = SIDE_ILLEGAL,
00156 AngDeg *angMax = NULL );
00157 SoccerCommand mark ( ObjectT o,
00158 double dDist,
00159 MarkT mark );
00160 SoccerCommand defendGoalLine ( double dDist );
00161 SoccerCommand interceptScoringAttempt ( );
00162 SoccerCommand holdBall ( );
00163
00165
00166 VecPosition getThroughPassShootingPoint( ObjectT objTeam,
00167 VecPosition posEnd,
00168 AngDeg *angMax );
00169 VecPosition getInterceptionPointBall( int *iCyclesBall,
00170 bool isGoalie );
00171 VecPosition getActiveInterceptionPointBall
00172 ( int *iCyclesBall,
00173 bool isGoalie );
00174 VecPosition getDribblePoint ( DribbleT dribble,
00175 double *dDist );
00176 VecPosition getShootPositionOnLine ( VecPosition p1,
00177 VecPosition p2,
00178 AngDeg *angLargest = NULL );
00179 double getEndSpeedForPass ( ObjectT o,
00180 VecPosition posPass );
00181 VecPosition getMarkingPosition ( ObjectT o,
00182 double dDist,
00183 MarkT mark );
00184 double getInterestRadius ( double dDist );
00185
00186 } ;
00187
00188 #endif