public class Phase
extends java.lang.Object
Constructor and Description |
---|
Phase(Board gameBoard,
java.util.List<Player> playerList,
int cycleDelay,
InteractableGame game)
Instantiates a new phase
|
Modifier and Type | Method and Description |
---|---|
void |
checkAllFlags()
Checks all flags for robots.
|
void |
fireAllLasers()
Fires all lasers on the game board
|
void |
makeMove(RobotID robotID,
Action action)
Makes the given robot move according to to the action input.
|
void |
moveAllConveyorBelts()
Moves robots standing on conveyor belts in the direction of the conveyor belt
In addition, the function rotates appropriately when arriving at any non-straight conveyor belt.
|
void |
rotateCogwheels()
Rotates all robots that are standing on cogWheel tiles on the board.
|
void |
runPhase(int phaseNumber)
Runs one phase as defined in the Robo Rally rulebook
|
void |
runProgrammingCards(int phase)
Runs all programming cards for a phase
|
public Phase(Board gameBoard, java.util.List<Player> playerList, int cycleDelay, InteractableGame game)
gameBoard
- The board to act onplayerList
- A list of players participating in the gamecycleDelay
- The amount of milliseconds to wait between movesgame
- The game which uses this objectpublic void runPhase(int phaseNumber) throws java.lang.InterruptedException
phaseNumber
- The number of the phase to runjava.lang.InterruptedException
- If interrupted wile trying to sleeppublic void checkAllFlags()
public void fireAllLasers() throws java.lang.InterruptedException
java.lang.InterruptedException
- If it gets interrupted while trying to sleeppublic void runProgrammingCards(int phase) throws java.lang.InterruptedException
phase
- The number of the phase to run cards forjava.lang.InterruptedException
- If it gets interrupted while trying to sleeppublic void rotateCogwheels() throws java.lang.InterruptedException
java.lang.InterruptedException
- If interrupted while sleeping.public void moveAllConveyorBelts() throws java.lang.InterruptedException
In addition, the function rotates appropriately when arriving at any non-straight conveyor belt.
java.lang.InterruptedException
- If disturbed during sleeppublic void makeMove(RobotID robotID, Action action) throws java.lang.InterruptedException
robotID
- The ID of the robot to move.action
- The specific movement the robot is to take.java.lang.InterruptedException
- If interrupted wile trying to sleep.