public class RoboRallyGame extends java.lang.Object implements DrawableGame, InteractableGame
Constructor and Description |
---|
RoboRallyGame(java.util.List<Player> playerList,
java.lang.String boardName,
java.lang.String playerName,
RoboRallyServer server,
java.lang.Boolean testingMode)
Instantiates a new Robo Rally game
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Robot> |
getAllRobots()
Gets a list of all robots still participating
|
ProgrammingCardDeck |
getExtraCards()
Gets extra cards necessary when the player has no program to lock
|
GameState |
getGameState()
Gets the current state of the game
|
int |
getHeight()
Gets the number of tiles in the y direction
|
java.util.List<Particle> |
getParticlesToDraw()
Gets a list of all the particles to be drawn
Should return a list readable from top-left to top-right and so on.
|
ProgrammingCardDeck |
getPlayerHand()
Gets the hand of this player
|
java.util.List<Player> |
getPlayers()
Gets a list of active players to receive information about player names
|
java.util.List<ProgrammingCard> |
getProgram()
Gets the program of this player
|
int |
getProgramSize()
Gets the amount of cards the player can choose for their program
|
java.lang.Boolean |
getRobotPowerDown()
Gets the power down status of the client playing this instance of the game
|
java.util.List<Robot> |
getRobotsToDraw()
Gets a list of all robots to draw
|
java.util.List<Tile> |
getTilesToDraw()
Gets a list of all the tiles to be drawn
Should return a list readable from top-left to top-right and so on.
|
java.util.List<Wall> |
getWallsToDraw()
Gets a list of all the walls to be drawn
Should return a list readable from top-left to top-right and so on.
|
int |
getWidth()
Gets the number of tiles in the x direction
|
java.lang.String |
getWinningPlayerName()
Gets the name of the player who won
|
void |
receiveAllPrograms(ProgramsContainerResponse programs)
Continues turn when programs for all players are received from the server
|
void |
receiveStayInPowerDown(PowerDownContainerResponse powerDowns)
Continues turn when stay in power down is received from all players
|
void |
runTurn()
Starts a turn in the game
|
void |
setExtraCards(ProgrammingCardDeck extraCards)
Sets extra cards necessary when the player has no program to lock
|
void |
setGameState(GameState gameState)
Sets the state of the game
|
void |
setPlayerHand(ProgrammingCardDeck playerHand)
Sets the hand of this player
|
void |
setProgram(java.util.List<ProgrammingCard> program)
Sets the program of this player
|
void |
setWinningPlayerName(java.lang.String winningPlayerName)
Sets the name of the player that won the game
|
public RoboRallyGame(java.util.List<Player> playerList, java.lang.String boardName, java.lang.String playerName, RoboRallyServer server, java.lang.Boolean testingMode)
playerList
- A list of all the players participating in the gameboardName
- The playerName of the board to useplayerName
- The name of the player of this instance of the gameserver
- The server if this player is host. Should be null otherwisetestingMode
- Whether the game should use the test deck rather than the proper deckpublic java.lang.Boolean getRobotPowerDown()
public int getWidth()
DrawableGame
getWidth
in interface DrawableGame
public int getHeight()
DrawableGame
getHeight
in interface DrawableGame
public java.util.List<Tile> getTilesToDraw()
DrawableGame
Should return a list readable from top-left to top-right and so on. In other words, the first getWidth() tiles should be drawn on the top row from left to right.
getTilesToDraw
in interface DrawableGame
public java.util.List<Wall> getWallsToDraw()
DrawableGame
Should return a list readable from top-left to top-right and so on. In other words, the first getWidth() walls should be drawn on the top row from left to right.
getWallsToDraw
in interface DrawableGame
public java.util.List<Particle> getParticlesToDraw()
DrawableGame
Should return a list readable from top-left to top-right and so on. In other words, the first getWidth() particles should be drawn on the top row from left to right.
getParticlesToDraw
in interface DrawableGame
public java.util.List<Robot> getRobotsToDraw()
DrawableGame
getRobotsToDraw
in interface DrawableGame
public java.util.List<Robot> getAllRobots()
DrawableGame
getAllRobots
in interface DrawableGame
public java.util.List<Player> getPlayers()
DrawableGame
getPlayers
in interface DrawableGame
public GameState getGameState()
InteractableGame
getGameState
in interface InteractableGame
public void setGameState(GameState gameState)
InteractableGame
setGameState
in interface InteractableGame
gameState
- The new state of the gamepublic ProgrammingCardDeck getPlayerHand()
InteractableGame
getPlayerHand
in interface InteractableGame
public void setPlayerHand(ProgrammingCardDeck playerHand)
InteractableGame
setPlayerHand
in interface InteractableGame
playerHand
- The new hand of this playerpublic ProgrammingCardDeck getExtraCards()
InteractableGame
getExtraCards
in interface InteractableGame
public void setExtraCards(ProgrammingCardDeck extraCards)
InteractableGame
setExtraCards
in interface InteractableGame
extraCards
- The extra cards to usepublic java.util.List<ProgrammingCard> getProgram()
InteractableGame
getProgram
in interface InteractableGame
public void setProgram(java.util.List<ProgrammingCard> program)
InteractableGame
setProgram
in interface InteractableGame
program
- The program of this playerpublic int getProgramSize()
InteractableGame
getProgramSize
in interface InteractableGame
public void receiveAllPrograms(ProgramsContainerResponse programs) throws java.lang.InterruptedException
InteractableGame
receiveAllPrograms
in interface InteractableGame
programs
- The programs container received from the serverjava.lang.InterruptedException
- If interrupted during sleeppublic void receiveStayInPowerDown(PowerDownContainerResponse powerDowns)
InteractableGame
receiveStayInPowerDown
in interface InteractableGame
powerDowns
- The power down container received from the serverpublic java.lang.String getWinningPlayerName()
InteractableGame
getWinningPlayerName
in interface InteractableGame
public void setWinningPlayerName(java.lang.String winningPlayerName)
InteractableGame
setWinningPlayerName
in interface InteractableGame
winningPlayerName
- The player winning the gamepublic void runTurn()