interceptball.cpp.svn-base

来自「一个巴西大学编写的2D仿真组足球机器人程序」· SVN-BASE 代码 · 共 45 行

SVN-BASE
45
字号
#include "InterceptBall.h"SoccerCommand InterceptBall::primaryAction(){   /*Log.log( 100, "I am fastest to ball;");   primarySoc = intercept( false );                      // intercept the ball   if( primarySoc.commandType == CMD_DASH &&             // if stamina low         WM->getAgentStamina().getStamina() <         SS->getRecoverDecThr()*SS->getStaminaMax()+200 )   {      primarySoc.dPower = 30.0 * WM->getAgentStamina().getRecovery(); // dash slow   }// if stamina high*/   return primarySoc;  // dash as intended}SoccerCommand InterceptBall::cuncurrentAction(){   return turnNeckToObject( OBJECT_BALL, primarySoc );}void InterceptBall::InterceptDefault(){   Log.log( 100, "I am fastest to ball;");   primarySoc = intercept( false );                      // intercept the ball   if( primarySoc.commandType == CMD_DASH &&             // if stamina low         WM->getAgentStamina().getStamina() <         SS->getRecoverDecThr()*SS->getStaminaMax()+200 )   {      primarySoc.dPower = 30.0 * WM->getAgentStamina().getRecovery(); // dash slow   }// if stamina high}void InterceptBall::InterceptFast(){   Log.log( 100, "I am fastest to ball;");   primarySoc = intercept( false );                      // intercept the ball}void InterceptBall::InterceptSlow(){   Log.log( 100, "I am fastest to ball;");   primarySoc = intercept( false );                      // intercept the ball   primarySoc.dPower = 30.0 * WM->getAgentStamina().getRecovery(); // dash slow}

⌨️ 快捷键说明

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