PlayerTeams C++文件

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

/*

Copyright (c) 2000-2003, Jelle Kok, University of Amsterdam

All rights reserved.

Redistribution and use in source and binary forms, with or without

modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this

list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation

and/or other materials provided with the distribution.

3. Neither the name of the University of Amsterdam nor the names of its

contributors may be used to endorse or promote products derived from this

software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

IMPLIED W ARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE

FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR

SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER

CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,

OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

/*! \file PlayerTeams.cpp

File: PlayerTest.cpp

Project: Robocup Soccer Simulation Team: UvA Trilearn

Authors: Jelle Kok

Created: 10/12/2000

Last Revision: $ID$

Contents: This file contains the class definitions for the

Player that are used to test the teams' high level

strategy.


Changes

Date Author Comment

10/12/2000 Jelle Kok Initial version created

*/

#include "Player.h"

/*!This method is the first complete simple team and defines the actions taken by all the players on the field (excluding the goalie). It is based on the

high-level actions taken by the simple team FC Portugal that it released in

2000. The players do the following:

- if ball is kickable

kick ball to goal (random corner of goal)

- else if i am fastest player to ball

intercept the ball

- else

move to strategic position based on your home position and pos ball */ SoccerCommand Player::deMeer5( )

{

static FormationT ftChange=FT_BlueSky_442A; //记录要更改的阵形,默认使用FT_BlueSky_442A阵形

SoccerCommand soc(CMD_ILLEGAL);//初始化一个无效指令

VecPosition posAgent = WM->getAgentGlobalPosition();//取得当前球员的位置VecPosition posBall = WM->getBallPos();//取得球的位置

int iTmp;//临时变量

if( !WM->isBeforeKickOff( ) )

{

//队形不正确首先调整队形

if(formations->getFormation()!=ftChange)

formations->setFormation( ftChange );

//需要根据不同的比赛状态来采取同的行动方针

if( WM->getConfidence( OBJECT_BALL ) < PS->getBallConfThr() )

{

ACT->putCommandInQueue( soc = searchBall() ); // if ball pos unknown

相关文档
最新文档