public abstract class ServerGameManager extends GameManager implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Boolean> |
discardList |
protected java.util.Map<java.lang.Integer,java.lang.Integer> |
playerIndexLookup |
protected boolean |
randomNumbers |
protected boolean |
randomPorts |
protected boolean |
randomTiles |
protected static long |
serialVersionUID |
gameBank, gameID, gameState, gameTitle, log, map, offeredTrade, playerCanMoveRobber, playerColors, players, version, victoryPointManager, waterCooler
Constructor and Description |
---|
ServerGameManager() |
ServerGameManager(java.lang.String name,
boolean randomTiles,
boolean randomNumbers,
boolean randomPorts) |
Modifier and Type | Method and Description |
---|---|
abstract int |
GetPlayerIndexByID(int playerID)
Returns the player index by id
|
protected abstract void |
initDiscard(boolean shouldBeBlank)
Initializes the discard list.
|
abstract boolean |
ServerAcceptTrade(int playerIndex,
boolean willAccept)
accepts a trade
|
abstract boolean |
ServerBuildCity(int playerIndex,
Coordinate p)
builds a city
|
abstract boolean |
ServerBuildRoad(int playerID,
Coordinate start,
Coordinate end,
boolean free)
builds a road
|
abstract boolean |
ServerBuildSettlement(int playerIndex,
Coordinate p,
boolean free)
builds settlement
|
abstract boolean |
ServerBuyDevCard(int playerID)
Buys a dev card
|
abstract boolean |
ServerDiscardCards(int playerIndex,
java.util.List<java.lang.Integer> resourceList)
discards cards
|
abstract boolean |
ServerFinishTurn(int playerID)
Ends a player's turn
|
abstract GameModel |
ServerGetModel()
Gets the current game model
|
java.io.Serializable |
ServerGetSerializableModel()
Gets the server's current game model in a serializable form
|
abstract boolean |
ServerMaritimeTrading(int playerIndex,
int ratio,
ResourceType input,
ResourceType output)
trades in the maritime
|
abstract boolean |
ServerMonopoly(int playerIndex,
ResourceType res1)
plays a monopoly card
|
abstract boolean |
ServerMonument(int playerIndex)
plays a monument card
|
abstract boolean |
ServerOfferTrade(int playerIndexOffering,
int playerIndexReceiving,
java.util.List<java.lang.Integer> resourceList)
offers a trade
|
abstract boolean |
ServerRoadBuilding(int playerIndex,
Coordinate start1,
Coordinate end1,
Coordinate start2,
Coordinate end2)
plays a road building card
|
abstract boolean |
ServerRobPlayer(int playerIndex,
int victimIndex,
Coordinate location) |
abstract boolean |
ServerRollNumber(int playerIndex,
int number) |
abstract boolean |
ServerSendChat(int playerID,
java.lang.String message)
Sends a chat for the user
|
abstract boolean |
ServerSoldier(int playerID,
Coordinate location,
int victimIndex)
plays a solider card
|
abstract boolean |
ServerYearOfPlenty(int playerIndex,
ResourceType res1,
ResourceType res2)
plays a year of plenty card
|
void |
SetGameID(int id)
Sets the game ID of the Game Manager
|
protected abstract ResourceType |
takeRandomResourceCard(int receiver,
int giver)
takes a random resource from one player and gives it to another
|
protected abstract void |
updateVersion()
Updates the version when doing an action
|
AddPlayer, AddPlayer, allCurrentPlayers, BuildCity, BuildRoad, BuildSettlement, BuyDevCard, canAcceptTrade, CanBuildCity, CanBuildCity, CanBuildRoad, CanBuildRoad, CanBuildSettlement, CanBuildSettlement, CanBuyDevCard, canChat, CanDiscardCards, CanFinishTurn, CanFinishTurn, CanMaritimeTrade, CanOfferTrade, CanPlaceRobber, CanPlayDevCard, CanPlayerPlay, CanRollNumber, CanUseMonopoly, CanUseMonument, CanUseRoadBuilder, CanUseSoldier, CanUseYearOfPlenty, CurrentPlayerChat, CurrentPlayersTurn, CurrentState, DiceRoll, FinishTurn, getBankResourceCount, getChat, GetCurrentPlayer, getCurrentPlayerName, getGameActionLog, GetGameID, GetGameTitle, getNumberPlayers, GetPlayer, getPlayerColorByIndex, GetPlayerIDbyIndex, getPlayerIndexByColor, getPlayerNameByIndex, getTradeRatio, GetVersion, getVictoryPointManager, hasGameStarted, LogAction, NeedToDiscardAfterRoll, NumberActivePlayers, payDayForDayz, placeRobber, playDevCard, PlayerChat, playerDevCardCount, playerDevCardCount, playerPieceCount, playerResourceCount, removeTradeOffer, reset, RollDice, SetPlayers, setTradeOffer, StartGame
protected static final long serialVersionUID
protected boolean randomTiles
protected boolean randomNumbers
protected boolean randomPorts
protected java.util.Map<java.lang.Integer,java.lang.Integer> playerIndexLookup
protected java.util.List<java.lang.Boolean> discardList
public ServerGameManager(java.lang.String name, boolean randomTiles, boolean randomNumbers, boolean randomPorts)
public ServerGameManager()
public void SetGameID(int id)
id
- The game ID.protected abstract void initDiscard(boolean shouldBeBlank)
shouldBeBlank
- whether to set all values to falseprotected abstract void updateVersion()
public abstract int GetPlayerIndexByID(int playerID)
playerID
- public abstract boolean ServerSendChat(int playerID, java.lang.String message)
playerID
- by Player IDmessage
- to chat withpublic abstract boolean ServerRollNumber(int playerIndex, int number)
playerID
- number
- public abstract boolean ServerRobPlayer(int playerIndex, int victimIndex, Coordinate location)
playerID
- the ID of the player who is moving the robbervictimIndex
- the index of the victimlocation
- the new location of the robberpublic abstract boolean ServerFinishTurn(int playerID)
playerID
- public abstract boolean ServerBuyDevCard(int playerID)
playerID
- public abstract boolean ServerYearOfPlenty(int playerIndex, ResourceType res1, ResourceType res2)
playerIndex
- res1
- res2
- public abstract boolean ServerMonopoly(int playerIndex, ResourceType res1)
playerIndex
- res1
- public abstract boolean ServerMonument(int playerIndex)
playerIndex
- public abstract boolean ServerRoadBuilding(int playerIndex, Coordinate start1, Coordinate end1, Coordinate start2, Coordinate end2)
playerIndex
- start1
- end1
- start2
- end2
- public abstract boolean ServerSoldier(int playerID, Coordinate location, int victimIndex)
playerID
- location
- victimIndex
- the victimpublic abstract boolean ServerBuildRoad(int playerID, Coordinate start, Coordinate end, boolean free)
playerID
- p
- public abstract boolean ServerBuildCity(int playerIndex, Coordinate p)
playerIndex
- p
- public abstract boolean ServerBuildSettlement(int playerIndex, Coordinate p, boolean free)
playerIndex
- p
- public abstract boolean ServerOfferTrade(int playerIndexOffering, int playerIndexReceiving, java.util.List<java.lang.Integer> resourceList)
playerIndexOffering
- playerIndexReceiving
- resourceList
- public abstract boolean ServerAcceptTrade(int playerIndex, boolean willAccept)
playerIndex
- willAccept
- public abstract boolean ServerMaritimeTrading(int playerIndex, int ratio, ResourceType input, ResourceType output)
playerIndex
- ratio
- input
- output
- public abstract boolean ServerDiscardCards(int playerIndex, java.util.List<java.lang.Integer> resourceList)
playerIndex
- resourceList
- protected abstract ResourceType takeRandomResourceCard(int receiver, int giver)
receiver
- giver
- public java.io.Serializable ServerGetSerializableModel()
public abstract GameModel ServerGetModel()