public class CommandFactory extends Object
Constructor and Description |
---|
CommandFactory()
Constructs a blank command factory.
|
Modifier and Type | Method and Description |
---|---|
void |
addByeCommand()
This is used to disconnect a player/coach/trainer from the server.
|
void |
addCatchCommand(int direction)
Goalie special command.
|
void |
addChangePlayerTypeCommand(int unum,
Object playerType)
Coach only command.
|
void |
addChangePlayerTypeCommand(String teamName,
int unum,
int playerType)
Trainer only command.
|
void |
addChangePlayModeCommand(PlayMode playMode)
Trainer only command.
|
void |
addChangeViewCommand(ViewAngle angle,
ViewQuality quality)
Changes the view parameters of the player.
|
void |
addCheckBallCommand()
Trainer only command.
|
void |
addCoachInitCommand(String teamName)
This is used to initialise the online coach.
|
void |
addDashCommand(int power)
This command accelerates the player in the direction of its body.
|
void |
addEarCommand(boolean earOn)
Trainer only command.
|
void |
addEyeCommand(boolean eyeOn)
Trainer command that can be used by online coach.
|
void |
addKickCommand(int power,
int direction)
This command accelerates the ball with the given power in the given direction.
|
void |
addLookCommand()
Trainer command that can be used by online coach.
|
void |
addMoveBallCommand(double x,
double y)
Trainer only command.
|
void |
addMoveCommand(int x,
int y)
This command can only be executed before kick off or after a goal.
|
void |
addMovePlayerCommand(ActionsPlayer p,
double x,
double y)
Trainer only command.
|
void |
addPlayerInitCommand(String teamName,
boolean isGoalie)
This is used to initialise a player.
|
void |
addReconnectCommand(String teamName,
int num)
This is used to reconnect the player to the server.
|
void |
addRecoverCommand()
Trainer only command.
|
void |
addSayCommand(String message)
This command broadcasts the message throughout the field.
|
void |
addStartCommand()
Trainer only command.
|
void |
addTeamGraphicCommand(XPMImage xpm)
Coach only command.
|
void |
addTeamNamesCommand()
Trainer command that can be used by online coach.
|
void |
addTrainerInitCommand()
This is used to initialise a trainer.
|
void |
addTurnCommand(int angle)
This command will turn the players body in degrees relative to their
current direction.
|
void |
addTurnNeckCommand(int angle)
This command can be sent (and will be executed) each cycle independently,
along with other action commands.
|
boolean |
hasNext()
Checks if the stack is empty or not.
|
String |
next()
Gets the next command from the stack.
|
public void addPlayerInitCommand(String teamName, boolean isGoalie)
teamName
- The team the player belongs to.isGoalie
- If the player is a goalie. Note: Only one goalie per team.public void addTrainerInitCommand()
public void addCoachInitCommand(String teamName)
teamName
- The team the coach belongs to.public void addReconnectCommand(String teamName, int num)
teamName
- a String
object.num
- a int.public void addCatchCommand(int direction)
direction
- The direction in which to catch, relative to its body.public void addChangeViewCommand(ViewAngle angle, ViewQuality quality)
angle
- Between NARROW, NORMAL or WIDE.quality
- Between HIGH or LOW.public void addDashCommand(int power)
power
- Power is between minpower (-100) and maxpower (+100).public void addKickCommand(int power, int direction)
power
- Power is between minpower (-100) and maxpower (+100).direction
- Direction is relative to the body of the player.public void addMoveCommand(int x, int y)
x
- X location (between -54 and +54).y
- Y location (between -32 and +32).public void addTurnCommand(int angle)
angle
- Angle to turn (between -180 and +180).public void addTurnNeckCommand(int angle)
angle
- Angle to turn the neck (between minneckang and maxneckang) (-90 to +90)public void addSayCommand(String message)
message
- A valid String to say.public void addChangePlayModeCommand(PlayMode playMode)
playMode
- a PlayMode
object.public void addMovePlayerCommand(ActionsPlayer p, double x, double y)
p
- The player to move.x
- The x coordinate to move to.y
- The y coordinate to move to.public void addMoveBallCommand(double x, double y)
x
- The x coordinate to move to.y
- The y coordinate to move to.public void addCheckBallCommand()
public void addStartCommand()
public void addRecoverCommand()
public void addEarCommand(boolean earOn)
earOn
- True to turn auditory information on, false to turn it off.public void addChangePlayerTypeCommand(String teamName, int unum, int playerType)
teamName
- The name of the team the player belongs to.unum
- The players uniform number (1~11 on pitch usually, subs <= 14).playerType
- A player type between 0 (the standard player) and 18. However, player.conf can change this.public void addEyeCommand(boolean eyeOn)
eyeOn
- True to turn visual information on, false to turn it off.public void addLookCommand()
public void addTeamNamesCommand()
public void addChangePlayerTypeCommand(int unum, Object playerType)
unum
- The players uniform number (1~11 on pitch usually, subs <= 17).playerType
- //TODO Implementpublic void addTeamGraphicCommand(XPMImage xpm)
xpm
- An XPMImage object.public void addByeCommand()
public String next()
public boolean hasNext()
Copyright © 2003–2015 Atan. All rights reserved.