📄 withoutballplayondecision.cpp
字号:
/* * Copyright 2002-2005, Mersad Team, Allameh Helli High School (NODET). * * This program is free software, you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This program 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 Library General Public License for more details. * * This file is created by: Ahmad Boorghany * * Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. * For more information please read README file.*/#include <Block.h>#include <Tackle.h>#include <Defense.h>#include <Offense.h>#include <Intercept.h>#include <GoaliePositioning.h>#include <WithoutBallPlayOnDecision.h>#include <AdvancedAgent.h>#include <cassert>#define TACKLE_NUM 0#define BLOCK_NUM 1#define DEFENSE_NUM 2#define OFFENSE_NUM 3#define DRIBBLE_INTERCEPT_NUM 4#define INTERCEPT_NUM 5WithoutBallPlayOnDecision::WithoutBallPlayOnDecision( const WorldModel *worldModel): BodyDecision(worldModel){ addAdvancedAction(new Tackle(worldModel), AdvancedActionWeights(0, 1, 1), 2); addAdvancedAction(new Block(worldModel), AdvancedActionWeights(0, 1, 1), 2); addAdvancedAction(new Defense(worldModel), AdvancedActionWeights(0, 1, 1), 1); addAdvancedAction(new Offense(worldModel), AdvancedActionWeights(0, 1, 1), 1); addAdvancedAction(new DribbleIntercept(worldModel), AdvancedActionWeights(0, 1, 1), 2); addAdvancedAction(new Intercept(worldModel), AdvancedActionWeights(0, 1, 1), 1);}WithoutBallPlayOnDecision::~WithoutBallPlayOnDecision(){}void WithoutBallPlayOnDecision::decide(int quickLevel, WithoutBallSelection selection, Form &form, const Library &library){ resetQuickLevels(); quickLevels[TACKLE_NUM] = 2; switch (selection) { case WOBS_BLOCK: quickLevels[DEFENSE_NUM] = 1; quickLevels[BLOCK_NUM] = 2; form.headForm.tnMode = TNM_AUTO_PLAY_ON; break; case WOBS_INTERCEPT: quickLevels[INTERCEPT_NUM] = 1; if (library.lastBodyCycleCommand->getCreator() == AT_DRIBBLE || library.lastBodyCycleCommand->getCreator() == AT_SRPDRIBBLE || library.lastBodyCycleCommand->getCreator() == AT_DRIBBLE_INTERCEPT) quickLevels[DRIBBLE_INTERCEPT_NUM] = 2; form.headForm.tnMode = TNM_AUTO_PLAY_ON; break; case WOBS_OFFENSE: quickLevels[DEFENSE_NUM] = 1; // Maybe Temporary form.headForm.tnMode = TNM_AUTO_PLAY_ON; break; case WOBS_DEFENSE: quickLevels[DEFENSE_NUM] = 1; form.headForm.tnMode = TNM_AUTO_PLAY_ON; break; case WOBS_POSITIONING: case WOBS_LOOKFORBALL: assert(0); } BodyDecision::decide(quickLevel, form, library);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -