public class MovesOfferTradeCommand extends MovesCommand
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<java.lang.Integer> |
offer |
private int |
receiverIndex |
private ServerGameManager |
sgm |
playerIndexgameID, playerID| Constructor and Description |
|---|
MovesOfferTradeCommand(NetworkCookie cookie,
int playerIndex,
int receiverIndex,
java.util.List<java.lang.Integer> offer)
Creates a command that offers a 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 receiverIndex
private java.util.List<java.lang.Integer> offer
public MovesOfferTradeCommand(NetworkCookie cookie, int playerIndex, int receiverIndex, java.util.List<java.lang.Integer> offer)
cookie - The player ID/game IDplayerIndex - The player index.receiverIndex - The index of the receiver.offer - The resources being offered. (brick, ore, sheep, wheat, wood; + is what is offered by
the player, - is what the player is hoping to receive)public boolean Execute()
ICommandpublic boolean Unexecute()
ICommandpublic java.lang.String GetResponse()
ICommandpublic java.lang.String GetHeader()
ICommand