Class Round
java.lang.Object
it.polimi.ingsw.server.model.game_logic.Round
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ActionPhaseSubTurnprivate Phaseprivate intprivate booleanprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the current action phaseThis method returns the current phase.intThis method returns the current round countThis method returns the current round ordervoidThis method increases the round countbooleanThis method returns true if the current round is also the last, false otherwisebooleanThis method returns true if the final round is done, false otherwisebooleanThis method returns true if a round is finished, false otherwiseintnext()This method returns the ID of the next schoolBoard that will playvoidThis method resets the internal iterator that iterates over the list representing the round ordervoidsetActionPhaseSubTurn(ActionPhaseSubTurn actionPhaseSubTurn) This method sets the phase of the ACTION phase sub-turnvoidsetCurrentPhase(Phase currentPhase) This method sets the current phasevoidThis method is used to set to true a flag that signals that the current round will be the lastvoidsetNewRoundOrder(List<Integer> roundOrder) This method is used to set the new round order after every player played its card during the planning phase
-
Field Details
-
roundOrder
-
iterator
private int iterator -
currentRound
private int currentRound -
isLastRound
private boolean isLastRound -
currentPhase
-
actionPhaseSubTurn
-
-
Constructor Details
-
Round
-
-
Method Details
-
setNewRoundOrder
This method is used to set the new round order after every player played its card during the planning phase- Parameters:
roundOrder- is a list containing the schoolBoard IDs ordered by the round order
-
resetIterator
public void resetIterator()This method resets the internal iterator that iterates over the list representing the round order -
isRoundDone
public boolean isRoundDone()This method returns true if a round is finished, false otherwise- Returns:
- true if a round is finished, false otherwise
-
next
public int next()This method returns the ID of the next schoolBoard that will play- Returns:
- an int representing the ID of the next schoolBoard that will play
-
getRoundOrder
This method returns the current round order- Returns:
- a list of IDs representing the current round order
-
increaseRoundCount
public void increaseRoundCount()This method increases the round count -
isLastRound
public boolean isLastRound()This method returns true if the current round is also the last, false otherwise- Returns:
- true if the current round is also the last, false otherwise
-
getCurrentRound
public int getCurrentRound()This method returns the current round count- Returns:
- an int representing the current round count
-
setIsLastRoundTrue
public void setIsLastRoundTrue()This method is used to set to true a flag that signals that the current round will be the last -
getCurrentPhase
This method returns the current phase. It can be either PLANNING or ACTION- Returns:
- the current phase
-
setCurrentPhase
This method sets the current phase- Parameters:
currentPhase- is the phase the game will be set to
-
setActionPhaseSubTurn
This method sets the phase of the ACTION phase sub-turn- Parameters:
actionPhaseSubTurn- is the ActionPhaseSubTurn the game will be set to
-
getActionPhaseSubTurn
This method returns the current action phase- Returns:
- the current action phase
-
isLastRoundDone
public boolean isLastRoundDone()This method returns true if the final round is done, false otherwise- Returns:
- true if the final round is done, false otherwise
-