public interface Serializer
Modifier and Type | Method and Description |
---|---|
java.lang.String |
sAcceptTradeReq(int playerIndex,
boolean willAccept)
Serializes a request to accept (or reject) a trade
|
java.lang.String |
sAddAIReq(AIType aitype)
Serializes a request to add AI to a game
|
java.lang.String |
sBuildCityReq(int playerIndex,
VertexLocation vertexLocation)
Serializes a request to build a city
|
java.lang.String |
sBuildRoadReq(int playerIndex,
EdgeLocation roadLocation,
boolean free)
Serializes a request to build a road
|
java.lang.String |
sBuildSettlementReq(int playerIndex,
VertexLocation vertexLocation,
boolean free)
Serializes a request to build a settlement
|
java.lang.String |
sBuyDevCardReq(int playerIndex)
Serializes a request to buy a development card
|
java.lang.String |
sCreateGameReq(boolean randomTiles,
boolean randomNumbers,
boolean randomPorts,
java.lang.String name)
Serializes data for requests to create a game
|
java.lang.String |
sCredentials(java.lang.String username,
java.lang.String password)
Serializes the information for any requests that require user credentials
|
java.lang.String |
sDiscardCardsReq(int playerIndex,
java.util.List<java.lang.Integer> resourceList)
Serializes a request to discard cards
|
java.lang.String |
sFinishTurnReq(int playerIndex)
Serializes a request to finish a turn
|
java.lang.String |
sJoinGameReq(int id,
CatanColor color)
Serializes a request from a user to join a game
|
java.lang.String |
sMaritimeTradeReq(int playerIndex,
int ratio,
ResourceType inputResource,
ResourceType outputResource)
Serializes a request to perform a maritime trade
|
java.lang.String |
sMonopolyCardReq(int playerIndex,
ResourceType resource)
Serializes a request to play a monopoly card
|
java.lang.String |
sMonumentCardReq(int playerIndex)
Serializes a request to play a monument card
|
java.lang.String |
sOfferTradeReq(int playerIndex,
java.util.List<java.lang.Integer> resourceList,
int receiver)
Serializes a request to offer a trade
|
java.lang.String |
sRoadBuildingCardReq(int playerIndex,
EdgeLocation edgeLoc1,
EdgeLocation edgeLoc2)
Serializes a request to play a road building card
|
java.lang.String |
sRobPlayerReq(int playerIndex,
int victimIndex,
HexLocation location)
Serializes a request to rob a player
|
java.lang.String |
sRollNumberReq(int playerIndex,
int number)
Serializes a request to roll a dice, where the result is already known
|
java.lang.String |
sSendChatReq(int playerIndex,
java.lang.String content)
Serializes a request to send a chat message
|
java.lang.String |
sSoldierCardReq(int playerIndex,
int victimIndex,
HexLocation location)
Serializes a request to play a soldier card
|
java.lang.String |
sYearOfPlentyCardReq(int playerIndex,
ResourceType resource1,
ResourceType resource2)
Serializes a request to play a Year of Plenty card
|
java.lang.String sCredentials(java.lang.String username, java.lang.String password) throws java.lang.Exception
username
- The user's usernamepassword
- The user's passwordjava.lang.Exception
java.lang.String sCreateGameReq(boolean randomTiles, boolean randomNumbers, boolean randomPorts, java.lang.String name) throws java.lang.Exception
randomTiles
- Whether to create a game with random tilesrandomNumbers
- Whether to create a game with random chit placementrandomPorts
- Whether to create a game with random portsname
- The name of the game to createjava.lang.Exception
java.lang.String sJoinGameReq(int id, CatanColor color) throws java.lang.Exception
id
- ID of the user who wishes to join the gamecolor
- The color the user requestsjava.lang.Exception
java.lang.String sAddAIReq(AIType aitype) throws java.lang.Exception
AIType
- The type of AI to add to the gamejava.lang.Exception
java.lang.String sSendChatReq(int playerIndex, java.lang.String content) throws java.lang.Exception
playerIndex
- The index of the player sending the chatcontent
- The chat contentjava.lang.Exception
java.lang.String sRollNumberReq(int playerIndex, int number) throws java.lang.Exception
playerIndex
- The index of the player who rollsnumber
- The number rolledjava.lang.Exception
java.lang.String sRobPlayerReq(int playerIndex, int victimIndex, HexLocation location) throws java.lang.Exception
playerIndex
- The index of the player doing the robbingvictimIndex
- The index of the victimlocation
- The new location of the robberjava.lang.Exception
java.lang.String sFinishTurnReq(int playerIndex) throws java.lang.Exception
playerIndex
- The index of the player who is finishing their turnjava.lang.Exception
java.lang.String sBuyDevCardReq(int playerIndex) throws java.lang.Exception
playerIndex
- The index of the player who is buying the development cardjava.lang.Exception
java.lang.String sYearOfPlentyCardReq(int playerIndex, ResourceType resource1, ResourceType resource2) throws java.lang.Exception
playerIndex
- The index of the player who wishes to play the cardresource1
- The first resource to take from the bankresource2
- The second resource to take from the bankjava.lang.Exception
java.lang.String sRoadBuildingCardReq(int playerIndex, EdgeLocation edgeLoc1, EdgeLocation edgeLoc2) throws java.lang.Exception
playerIndex
- The index of the player who wishes to play the cardedgeLoc1
- The location of the first roadedgeLoc2
- The location of the second roadjava.lang.Exception
java.lang.String sSoldierCardReq(int playerIndex, int victimIndex, HexLocation location) throws java.lang.Exception
playerIndex
- The index of the player who wishes to play the cardvictimIndex
- The index of the victimlocation
- The new hex location of the soldierjava.lang.Exception
java.lang.String sMonopolyCardReq(int playerIndex, ResourceType resource) throws java.lang.Exception
playerIndex
- The index of the player who wishes to play the cardresource
- The resource to have a monopoly onjava.lang.Exception
java.lang.String sMonumentCardReq(int playerIndex) throws java.lang.Exception
playerIndex
- The index of the player who wishes to play the cardjava.lang.Exception
java.lang.String sBuildRoadReq(int playerIndex, EdgeLocation roadLocation, boolean free) throws java.lang.Exception
playerIndex
- The index of the player who wishes to build the roadroadLocation
- The location of the roadfree
- Whether this road is free (doesn't cost resources) or notjava.lang.Exception
java.lang.String sBuildSettlementReq(int playerIndex, VertexLocation vertexLocation, boolean free) throws java.lang.Exception
playerIndex
- The index of the player who wishes to build the settlementvertexLocation
- Where to build the settlementfree
- Whether this settlement is free (doesn't cost resources) or notjava.lang.Exception
java.lang.String sBuildCityReq(int playerIndex, VertexLocation vertexLocation) throws java.lang.Exception
playerIndex
- The index of the player who wishes to build the cityvertexLocation
- Where to build the cityjava.lang.Exception
java.lang.String sOfferTradeReq(int playerIndex, java.util.List<java.lang.Integer> resourceList, int receiver) throws java.lang.Exception
playerIndex
- The index of the player offering the traderesourceList
- The list of resources being traded and asked forreceiver
- The index of the receiverjava.lang.Exception
java.lang.String sAcceptTradeReq(int playerIndex, boolean willAccept) throws java.lang.Exception
playerIndex
- The index of the player who is accepting or rejecting the tradewillAccept
- Whether the trade is acceptedjava.lang.Exception
java.lang.String sMaritimeTradeReq(int playerIndex, int ratio, ResourceType inputResource, ResourceType outputResource) throws java.lang.Exception
playerIndex
- The index of the player who is performing the traderatio
- The trade ratio of the portinputResource
- The resource being tradedoutputResource
- The resource being traded forjava.lang.Exception
java.lang.String sDiscardCardsReq(int playerIndex, java.util.List<java.lang.Integer> resourceList) throws java.lang.Exception
playerIndex
- The index of the player discarding cardsresourceList
- A resource list with the cards being discardedjava.lang.Exception