⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 withoutballplayondecision.cpp

📁 mersad源码 03年robocup 季军 可以研究一下大家
💻 CPP
字号:
/* *  Copyright 2002-2004, Mersad Team, Allame 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. * *  Created by: Ahmad Boorghany *  Released on Friday 1 April 2005 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>#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, SayDecisionFlags &sayFlags,		TurnNeckMode &turnNeckMode, const Positioning &positioning):		BodyDecision(worldModel, sayFlags, turnNeckMode){	addAdvancedAction(new Tackle(worldModel),		AdvancedActionWeights(0, 1, 1), 2);	addAdvancedAction(new Block(worldModel, positioning),		AdvancedActionWeights(0, 1, 1), 2);	addAdvancedAction(new Defense(worldModel, positioning),		AdvancedActionWeights(0, 1, 1), 1);	addAdvancedAction(new Offense(worldModel, positioning),		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(){}DecideType WithoutBallPlayOnDecision::decide(int quickLevel,		DecideType lastDecide, WithoutBallSelection selection){	resetQuickLevels();	quickLevels[TACKLE_NUM] = 2;	dynamic_cast<Tackle *>(advancedActions[TACKLE_NUM])->			giveLastDecide(lastDecide);	switch (selection)	{	case WOBS_BLOCK:		quickLevels[DEFENSE_NUM] = 1;		quickLevels[BLOCK_NUM] = 2;		dynamic_cast<Block *>(advancedActions[BLOCK_NUM])->				giveLastDecide(lastDecide);		turnNeckMode = TNM_AUTO_PLAY_ON;		break;	case WOBS_INTERCEPT:		quickLevels[INTERCEPT_NUM] = 1;		if (lastDecide == DT_DRIBBLE || lastDecide == DT_SRPDRIBBLE ||			lastDecide == DT_DRIBBLE_INTERCEPT)			quickLevels[DRIBBLE_INTERCEPT_NUM] = 2;		dynamic_cast<Intercept *>(advancedActions[INTERCEPT_NUM])->				giveLastDecide(lastDecide);		turnNeckMode = TNM_AUTO_PLAY_ON;		break;	case WOBS_POSITIONING:		quickLevels[DEFENSE_NUM] = 1;		turnNeckMode = TNM_AUTO_PLAY_ON;		break;	}	return BodyDecision::decide(quickLevel);}

⌨️ 快捷键说明

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