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
|
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 boolean getRobotPowerDown()
InteractableGamegetRobotPowerDown in interface InteractableGamepublic int getWidth()
DrawableGamegetWidth in interface DrawableGamepublic int getHeight()
DrawableGamegetHeight in interface DrawableGamepublic java.util.List<Tile> getTilesToDraw()
DrawableGameShould 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 DrawableGamepublic java.util.List<Wall> getWallsToDraw()
DrawableGameShould 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 DrawableGamepublic java.util.List<Particle> getParticlesToDraw()
DrawableGameShould 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 DrawableGamepublic java.util.List<Robot> getRobotsToDraw()
DrawableGamegetRobotsToDraw in interface DrawableGamepublic java.util.List<Robot> getAllRobots()
DrawableGamegetAllRobots in interface DrawableGamepublic java.util.List<Player> getPlayers()
DrawableGamegetPlayers in interface DrawableGamepublic GameState getGameState()
InteractableGamegetGameState in interface InteractableGamepublic void setGameState(GameState gameState)
InteractableGamesetGameState in interface InteractableGamegameState - The new state of the gamepublic ProgrammingCardDeck getPlayerHand()
InteractableGamegetPlayerHand in interface InteractableGamepublic void setPlayerHand(ProgrammingCardDeck playerHand)
InteractableGamesetPlayerHand in interface InteractableGameplayerHand - The new hand of this playerpublic ProgrammingCardDeck getExtraCards()
InteractableGamegetExtraCards in interface InteractableGamepublic void setExtraCards(ProgrammingCardDeck extraCards)
InteractableGamesetExtraCards in interface InteractableGameextraCards - The extra cards to usepublic java.util.List<ProgrammingCard> getProgram()
InteractableGamegetProgram in interface InteractableGamepublic void setProgram(java.util.List<ProgrammingCard> program)
InteractableGamesetProgram in interface InteractableGameprogram - The program of this playerpublic int getProgramSize()
InteractableGamegetProgramSize in interface InteractableGamepublic void receiveAllPrograms(ProgramsContainerResponse programs) throws java.lang.InterruptedException
InteractableGamereceiveAllPrograms in interface InteractableGameprograms - The programs container received from the serverjava.lang.InterruptedException - If interrupted during sleeppublic void receiveStayInPowerDown(PowerDownContainerResponse powerDowns)
InteractableGamereceiveStayInPowerDown in interface InteractableGamepowerDowns - The power down container received from the serverpublic java.lang.String getWinningPlayerName()
InteractableGamegetWinningPlayerName in interface InteractableGamepublic void setWinningPlayerName(java.lang.String winningPlayerName)
InteractableGamesetWinningPlayerName in interface InteractableGamewinningPlayerName - The player winning the gamepublic void runTurn()
InteractableGamerunTurn in interface InteractableGame