java.lang.Object
it.polimi.ingsw.server.model.game_logic.Round

public class Round extends Object
  • Field Details

    • roundOrder

      private List<Integer> roundOrder
    • iterator

      private int iterator
    • currentRound

      private int currentRound
    • isLastRound

      private boolean isLastRound
    • currentPhase

      private Phase currentPhase
    • actionPhaseSubTurn

      private ActionPhaseSubTurn actionPhaseSubTurn
  • Constructor Details

  • Method Details

    • setNewRoundOrder

      public void setNewRoundOrder(List<Integer> roundOrder)
      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

      public List<Integer> 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

      public Phase getCurrentPhase()
      This method returns the current phase. It can be either PLANNING or ACTION
      Returns:
      the current phase
    • setCurrentPhase

      public void setCurrentPhase(Phase currentPhase)
      This method sets the current phase
      Parameters:
      currentPhase - is the phase the game will be set to
    • setActionPhaseSubTurn

      public void setActionPhaseSubTurn(ActionPhaseSubTurn actionPhaseSubTurn)
      This method sets the phase of the ACTION phase sub-turn
      Parameters:
      actionPhaseSubTurn - is the ActionPhaseSubTurn the game will be set to
    • getActionPhaseSubTurn

      public ActionPhaseSubTurn 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