goalkeeperstates.h
来自「用人工智能实现的足球机器人人仿真比赛的程序」· C头文件 代码 · 共 132 行
H
132 行
#ifndef KEEPERSTATES_H
#define KEEPERSTATES_H
//------------------------------------------------------------------------
//
// Name: GoalKeeperStates.h
//
// Desc: Declarations of all the states used by a Simple Soccer
// goalkeeper
//
// Author: Mat Buckland 2003 (fup@ai-junkie.com)
//
//------------------------------------------------------------------------
#include <string>
#include "FSM/State.h"
#include "Messaging/Telegram.h"
#include "constants.h"
class GoalKeeper;
class SoccerPitch;
class GlobalKeeperState: public State<GoalKeeper>
{
private:
GlobalKeeperState(){}
public:
//this is a singleton
static GlobalKeeperState* Instance();
void Enter(GoalKeeper* keeper){}
void Execute(GoalKeeper* keeper){}
void Exit(GoalKeeper* keeper){}
bool OnMessage(GoalKeeper*, const Telegram&);
};
//-----------------------------------------------------------------------------
class TendGoal: public State<GoalKeeper>
{
private:
TendGoal(){}
public:
//this is a singleton
static TendGoal* Instance();
void Enter(GoalKeeper* keeper);
void Execute(GoalKeeper* keeper);
void Exit(GoalKeeper* keeper);
bool OnMessage(GoalKeeper*, const Telegram&){return false;}
};
//------------------------------------------------------------------------
class InterceptBall: public State<GoalKeeper>
{
private:
InterceptBall(){}
public:
//this is a singleton
static InterceptBall* Instance();
void Enter(GoalKeeper* keeper);
void Execute(GoalKeeper* keeper);
void Exit(GoalKeeper* keeper);
bool OnMessage(GoalKeeper*, const Telegram&){return false;}
};
//------------------------------------------------------------------------
class ReturnHome: public State<GoalKeeper>
{
private:
ReturnHome(){}
public:
//this is a singleton
static ReturnHome* Instance();
void Enter(GoalKeeper* keeper);
void Execute(GoalKeeper* keeper);
void Exit(GoalKeeper* keeper);
bool OnMessage(GoalKeeper*, const Telegram&){return false;}
};
//------------------------------------------------------------------------
class PutBallBackInPlay: public State<GoalKeeper>
{
private:
PutBallBackInPlay(){}
public:
//this is a singleton
static PutBallBackInPlay* Instance();
void Enter(GoalKeeper* keeper);
void Execute(GoalKeeper* keeper);
void Exit(GoalKeeper* keeper){}
bool OnMessage(GoalKeeper*, const Telegram&){return false;}
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?