samplescenario.cpp
来自「IRAN mesard_2d 2005源代码」· C++ 代码 · 共 81 行
CPP
81 行
/* * 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: Darioush Jalali * * Released on Monday 1 August 2005, 10 Mordad 1384 by Mersad RoboCup Team. * For more information please read README file.*/#include "SampleScenario.h"#include "Logger.h"#include <iostream>using namespace std;bool SampleScenario::startCondition(){ return true;}bool SampleScenario::endCondition() { return false;}void SampleScenario::setUp(){ LOG << "Warning: Doing stupid thing" << endl; cerr << "Warning: Doing stupid thing" << endl; Command * cmd = NULL; cmd = new MovePlayerCommand(AT_ADVANCED_COACH, OUR_TEAMNAME, 1, 10, 10, 20, 0.5, 0.5); connection->send(cmd); delete cmd; cmd = new ChangePlayModeCommand(AT_ADVANCED_COACH, "play_on"); connection->send(cmd); delete cmd; cmd = new MoveBallCommand(AT_ADVANCED_COACH, 0,0,0,1,1); connection->send(cmd); delete cmd; cmd = NULL ; // to be happy}void SampleScenario::monitor(){ LOG << "SampleScenario is now monitoring the scene ... " << endl; if (!(worldModel->getCurCycle() % 200)) { LOG << "Refreshing people!" << endl; Command * cmd = new RecoverCommand(AT_ADVANCED_COACH); connection->send(cmd); delete cmd; };}void SampleScenario::conclude() { LOG << "SampleScenario is now concluding ... " << endl;}void SampleScenario::cleanUp(){ Scenario::cleanUp();}SampleScenario::SampleScenario(const CoachWorldModel * worldModel, const CoachWorldModelHistory * worldModelHistory, Connection* connection) : Scenario(worldModel, worldModelHistory,connection){};SampleScenario::~SampleScenario() { } ;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?