Module AM37

Class Turn

java.lang.Object
it.polimi.ingsw.model.Turn

public class Turn
extends java.lang.Object
A container for a player turn

During each turn, the currentPlayer performs its actions based on the loaded strategy

  • Constructor Details

    • Turn

      public Turn​(int turnNumber, Player currentPlayer)
      Default constructor
      Parameters:
      turnNumber - the turn number
      currentPlayer - the player playing in this turn
  • Method Details

    • cloneTurn

      public Turn cloneTurn​(Game game)
      Creates a clone of this object
      Parameters:
      game - the game in which the turn was played
      Returns:
      a clone of the turn
    • getTurnNumber

      public int getTurnNumber()
      turnNumber getter
      Returns:
      the turn number
    • getCurrentPlayer

      public Player getCurrentPlayer()
      currentTurn getter
      Returns:
      the current player
    • getRuleSetStrategy

      public RuleSetStrategy getRuleSetStrategy()
      ruleSetStrategy getter
      Returns:
      the turn's strategy
    • buildDataClass

      public TurnData buildDataClass()
      Creates a TurnData object based on this turn
      Returns:
      this object's data class