Class Move

java.lang.Object
it.polimi.ingsw.Server.Controller.Move

public class Move extends Object
Move declaration, composed of list of coordinates and Shelf column
  • Field Details

    • column

      @Expose private int column
    • orderedCards

      @Expose private List<ObjectCard> orderedCards
    • x

      @Expose private List<Integer> x
    • y

      @Expose private List<Integer> y
    • board

      @Expose(serialize=false, deserialize=false) private Board board
    • shelf

      @Expose(serialize=false, deserialize=false) private Shelf shelf
  • Constructor Details

    • Move

      public Move(int column, List<Integer> x, List<Integer> y, Board board, Shelf shelf)
      Game's Move implementation
      Parameters:
      column - Library's column
      x - List of Move coordinates (x)
      y - List of Move coordinates (y)
      board - Game's Board
      shelf - Player's Shelf
  • Method Details

    • setBoardAndShelf

      public void setBoardAndShelf(Board board, Shelf shelf)
      Sets Move's Board and Shelf
      Parameters:
      board - Game's Board
      shelf - Player's Shelf
    • take

      public boolean take()
      Takes card from Board
      Returns:
      action validity
    • restoreTaken

      public void restoreTaken() throws Exception
      Restores taken cards on the Board (when Move was Invalid)
      Throws:
      Exception - related to Model management
    • place

      public boolean place()
      Places taken cards in the Player's Library
      Returns:
      action validity