Class BoardSpace

java.lang.Object
it.polimi.ingsw.Server.Model.BoardSpace

public class BoardSpace extends Object
Board Spaces
  • Field Details

    • x

      @Expose private final int x
      Coordinate
    • y

      @Expose private final int y
      Coordinate
    • usable

      @Expose private final boolean usable
      Usability of the space in the board/current game
    • dots

      @Expose private final Optional<Integer> dots
      Number of (eventual) dots in the space
    • card

      @Expose private Optional<ObjectCard> card
      (eventual) Object Card in the space
  • Constructor Details

    • BoardSpace

      public BoardSpace(int x, int y, boolean usable, Optional<Integer> dots)
      BoardSpace class constructor
      Parameters:
      x - coordinate
      y - coordinate
      usable - usability of a space in both absolute and players-dependent criteria
      dots - number of dots on that space (based on a number of players)
  • Method Details

    • getX

      public int getX()
      Returns:
      x coordinate
    • getY

      public int getY()
      Returns:
      y coordinate
    • isUsable

      public boolean isUsable()
      Returns:
      usability of the space
    • getCard

      public Optional<ObjectCard> getCard()
      Returns:
      card in the space (as an Optional)
    • setCard

      public void setCard(Optional<ObjectCard> card)
      Sets the card in the space
      Parameters:
      card - the card
    • getPlainCard

      public ObjectCard getPlainCard()
      Returns:
      card in the space (as a plain Nullable type)
    • getDots

      public Optional<Integer> getDots()
      Returns:
      number of dots in a space (as Optional)
    • getPlainDots

      public int getPlainDots()
      Returns:
      number of dots in a space (as a plain Nullable type)