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 
00049 #ifndef PLAYER
00050 #define PLAYER
00051 
00052 #include "BasicPlayer.h"
00053 #include "Formations.h"     
00054 
00055 #ifdef WIN32
00056   DWORD WINAPI stdin_callback( LPVOID v );
00057 #else
00058   void* stdin_callback( void * v );
00059 #endif
00060 
00061 
00064 class Player:public BasicPlayer
00065 {
00066   Formations    *formations;             
00067   bool          bContLoop;               
00069   Time          m_timeLastSay;           
00070   ObjectT       m_objMarkOpp;            
00071   ObjectT       m_objPassOption;         
00073   int           m_iPenaltyNr;            
00075   ActionT       m_actionPrev;            
00077   SoccerCommand goalieMainLoop            (                                  );
00078   SoccerCommand defenderMainLoop          (                                  );
00079   SoccerCommand midfielderMainLoop        (                                  );
00080   SoccerCommand attackerMainLoop          (                                  );
00081 
00082   void          performPenalty            (                                  );
00083 
00084 
00085   VecPosition   getDeadBallPosition       (                                  );
00086 
00087   
00088   bool          shallISaySomething        ( SoccerCommand  soc               );
00089   bool          amIAgentToSaySomething    ( SoccerCommand  soc               );
00090   void          sayOppAttackerStatus      ( char *         str               );
00091   void          sayBallStatus             ( char *         str               );
00092   void          makeBallInfo              ( VecPosition    posBall,
00093                                             VecPosition    velBall,
00094                                             int            iDiff, 
00095                                             char *         str               );
00096 
00097 public:
00098   Player                                  ( ActHandler     *a,
00099                                             WorldModel     *wm,
00100                                             ServerSettings *ss,
00101                                             PlayerSettings *cs,
00102                                             Formations     *fs,
00103                                             char           *strTeamName,
00104                                             double         dVersion,
00105                                             int            iReconnect = -1   );
00106 
00107   void          mainLoop                  (                                  );
00108 
00109 
00110   
00111   void          handleStdin               (                                  );
00112   void          showStringCommands        ( ostream& out                     );
00113   bool          executeStringCommand      ( char *str                        );
00114 
00115   
00116   SoccerCommand deMeer5                   (                                  );
00117   SoccerCommand deMeer5_goalie            (                                  );
00118 
00119 
00120 };
00121 
00122 #endif