public class MovesMaritimeTradeCommand extends MovesCommand
| Modifier and Type | Field and Description |
|---|---|
private ResourceType |
input |
private ResourceType |
output |
private int |
ratio |
private ServerGameManager |
sgm |
playerIndexgameID, playerID| Constructor and Description |
|---|
MovesMaritimeTradeCommand(NetworkCookie cookie,
int playerIndex,
int ratio,
ResourceType input,
ResourceType output)
Creates a command to perform a maritime trade.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Execute()
Executes a command
|
java.lang.String |
GetHeader()
Gets the new server header associated with the request.
|
java.lang.String |
GetResponse()
Gets the response for the server.
|
boolean |
Unexecute()
Unexecutes a command.
|
private ServerGameManager sgm
private int ratio
private ResourceType input
private ResourceType output
public MovesMaritimeTradeCommand(NetworkCookie cookie, int playerIndex, int ratio, ResourceType input, ResourceType output)
cookie - The player ID/game IDplayerIndex - The player index.ratio - The ratio of the trade (4:1, 3:1, 2:1).input - The input (what is being turned in by the player).output - The output (what is being received).public boolean Execute()
ICommandpublic boolean Unexecute()
ICommandpublic java.lang.String GetResponse()
ICommandpublic java.lang.String GetHeader()
ICommand