📄 command.h
字号:
/* * 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: Mohsen Izadi * Modified by: Ahmad Boorghany, Mohammad Salehe * Released on Friday 1 April 2005 by Mersad RoboCup Team. * For more information please read README file.*/#ifndef __COMMAND_H#define __COMMAND_H#include <string>#include <Types.h>#ifndef NULL# define NULL 0#endif // NULLenum CommandType{ CT_ATTENTION, CT_BYE, CT_CATCH, CT_CHANGE_VIEW, CT_DASH, CT_DONE, CT_EMPTY, CT_INIT, CT_KICK, CT_MOVE, CT_SAY, CT_TACKLE, CT_TURN, CT_TURN_NECK, CT_EYE, CT_FREEFORM, CT_CHANGE_PLAYER};class Command{public: Command(); virtual ~Command(); virtual std::string toString() const = 0;};class AttentionToCommand: public Command{protected: TeamId teamId; int uniformNum; public: AttentionToCommand(TeamId teamId, int uniformNum); virtual ~AttentionToCommand(); virtual std::string toString() const; // Getting functions TeamId getTeamId() const; int getUniformNum() const;};class ByeCommand: public Command{public: ByeCommand(); virtual ~ByeCommand(); virtual std::string toString() const;};class CatchCommand: public Command{protected: float direction; public: CatchCommand(float direction); virtual ~CatchCommand(); virtual std::string toString() const; // Getting functions float getDirection() const;};class ChangeViewCommand: public Command{protected: ViewModeQuality quality; ViewModeWidth width; public: ChangeViewCommand(ViewModeQuality quality, ViewModeWidth width); virtual ~ChangeViewCommand(); virtual std::string toString() const; // Getting functions ViewModeQuality getQuality() const; ViewModeWidth getWidth() const;};class DashCommand: public Command{protected: float power; public: DashCommand(float power); virtual ~DashCommand(); virtual std::string toString() const; // Getting functions float getPower() const; // Setting functions void setPower(float powerArg);};class DoneCommand: public Command{public: DoneCommand(); virtual ~DoneCommand(); virtual std::string toString() const;};class EmptyCommand: public Command{public: EmptyCommand(); virtual ~EmptyCommand(); virtual std::string toString() const;};class InitCommand: public Command{protected: std::string teamName; std::string version; bool isGoalie;public: InitCommand(const std::string &teamName, const std::string &version, bool isGoalie); virtual ~InitCommand(); virtual std::string toString() const; // Getting functions const std::string &getTeamName() const; const std::string &getVersion() const; bool getIsGoalie() const;};class KickCommand: public Command{protected: float power; float direction; public: KickCommand(float power, float direction); virtual ~KickCommand(); virtual std::string toString() const; // Getting functions float getPower() const; float getDirection() const; // Setting functions void setPower(float powerArg); void setDirection(float directionArg);};class MoveCommand: public Command{protected: float x; float y; public: MoveCommand(Point point); MoveCommand(float x, float y); virtual ~MoveCommand(); virtual std::string toString() const; // Getting functions float getX() const; float getY() const;};class PointToCommand: public Command{protected: bool status; float dist; float dir; public: PointToCommand(bool status = false); PointToCommand(float dist, float dir); virtual ~PointToCommand(); virtual std::string toString() const; // Getting functions float getDist() const; float getDir() const;};class SayCommand: public Command{protected: std::string message; public: SayCommand(const std::string &message); virtual ~SayCommand(); virtual std::string toString() const; // Getting functions const std::string &getMessage() const;};class TackleCommand: public Command{protected: float power; public: TackleCommand(float power); virtual ~TackleCommand(); virtual std::string toString() const; // Getting functions float getPower() const;};class TurnCommand: public Command{protected: float direction; public: TurnCommand(float direction); virtual ~TurnCommand(); virtual std::string toString() const; // Getting functions float getDirection() const;};class TurnNeckCommand: public Command{protected: float direction; public: TurnNeckCommand(float direction); virtual ~TurnNeckCommand(); virtual std::string toString() const; // Getting functions float getDirection() const;};class EyeCommand: public Command{protected: bool on; public: EyeCommand(bool on); virtual ~EyeCommand(); virtual std::string toString() const; // Getting functions bool isOn() const;};class ChangePlayerCommand: public Command{protected: int uniformNum; int playerType;public: ChangePlayerCommand(int uniformNum, int playerType); virtual ~ChangePlayerCommand(); virtual std::string toString() const; // Getting functions int getUniformNum() const; int getPlayerType() const;};class FreeFormCommand: public Command{protected: std::string message; public: FreeFormCommand(const std::string &message); virtual ~FreeFormCommand(); virtual std::string toString() const; // Getting functions const std::string &getMessage() const;};class CLangVersionCommand: public Command{protected: int minVer, maxVer; public: CLangVersionCommand(int minVer, int maxVer); virtual ~CLangVersionCommand(); virtual std::string toString() const; // Getting functions int getMinVer() const; int getMaxVer() const;};#endif // __COMMAND_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -