00001
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00032 #ifndef RCSC_ACTION_INTENTION_DRIBBLE_2007_H
00033 #define RCSC_ACTION_INTENTION_DRIBBLE_2007_H
00034
00035 #include <rcsc/player/soccer_intention.h>
00036 #include <rcsc/geom/vector_2d.h>
00037 #include <rcsc/game_time.h>
00038
00039 namespace rcsc {
00040
00041 class WorldModel;
00042
00047 class IntentionDribble2007
00048 : public SoccerIntention {
00049 private:
00050 const Vector2D M_target_point;
00051 const double M_dist_thr;
00052
00053 int M_turn_step;
00054 int M_dash_step;
00055
00056 const double M_dash_power_abs;
00057 const bool M_back_dash_mode;
00058
00059 GameTime M_last_execute_time;
00060
00061 public:
00072 IntentionDribble2007( const Vector2D & target_point,
00073 const double & dist_thr,
00074 const int turn_step,
00075 const int dash_step,
00076 const double & dash_power_abs,
00077 const bool back_dash,
00078 const GameTime & start_time )
00079 : M_target_point( target_point )
00080 , M_dist_thr( dist_thr )
00081 , M_turn_step( turn_step )
00082 , M_dash_step( dash_step )
00083 , M_dash_power_abs( dash_power_abs )
00084 , M_back_dash_mode( back_dash )
00085 , M_last_execute_time( start_time )
00086 { }
00087
00093 bool finished( const PlayerAgent* agent );
00094
00100 bool execute( PlayerAgent* agent );
00101
00102 private:
00103
00107 void clear()
00108 {
00109 M_turn_step = M_dash_step = 0;
00110 }
00111
00117 bool checkOpponent( const WorldModel & world );
00118
00124 bool doTurn( PlayerAgent * agent );
00125
00131 bool doDash( PlayerAgent * agent );
00132
00133 };
00134
00135 }
00136
00137 #endif