Class EndTurnCommand

java.lang.Object
ca.uqam.info.student.skyjo.controller.EndTurnCommand
All Implemented Interfaces:
ca.uqam.info.max.skyjo.controller.Command

public class EndTurnCommand extends Object implements ca.uqam.info.max.skyjo.controller.Command
Command representing the end of a player's turn. When executed, this command advances the game to the next player. If the current player has revealed all their cards and no game ender has been set yet, this player is marked as the game ender.
  • Constructor Details

    • EndTurnCommand

      public EndTurnCommand(ca.uqam.info.max.skyjo.model.SkyjoModel model)
      Constructs an EndTurnCommand associated with the given model.
      Parameters:
      model - the game model used to update the current player and game state
  • Method Details

    • execute

      public void execute()
      Specified by:
      execute in interface ca.uqam.info.max.skyjo.controller.Command
    • isSpaceholder

      public boolean isSpaceholder()
      Specified by:
      isSpaceholder in interface ca.uqam.info.max.skyjo.controller.Command
    • undo

      public void undo()
      Specified by:
      undo in interface ca.uqam.info.max.skyjo.controller.Command
    • isUndoable

      public boolean isUndoable()
      Specified by:
      isUndoable in interface ca.uqam.info.max.skyjo.controller.Command
    • getFollowUpCommands

      public ca.uqam.info.max.skyjo.controller.Command[] getFollowUpCommands()
      Specified by:
      getFollowUpCommands in interface ca.uqam.info.max.skyjo.controller.Command
    • toString

      public String toString()
      Overrides:
      toString in class Object