Class ReduceRowCommand

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

public class ReduceRowCommand extends Object implements ca.uqam.info.max.skyjo.controller.Command
This class is used to create a command for eliminating a determinate row to the player's grid.
  • Constructor Details

    • ReduceRowCommand

      public ReduceRowCommand(ca.uqam.info.max.skyjo.model.SkyjoModel model, int playerIndex, int positionY)
      Creates a command to eliminate a row.
      Parameters:
      model - the game model on which the command operates.
      playerIndex - the index of the current player executing the command
      positionY - the row that will be deleted.
  • Method Details

    • isSpaceholder

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

      public void execute()
      Specified by:
      execute 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