Class Square


  • public class Square
    extends Object
    Square on the board. A square has a type grass or star and it's all. A square doesn't know where it is on the board.
    Since:
    0.1.0
    Version:
    2.0.0
    Author:
    Andrew SASSOYE
    • Constructor Detail

      • Square

        public Square()
        Constructor
      • Square

        public Square​(SquareType type)
        Constructor of Square on board.
        Parameters:
        type - Square is grass or star
      • Square

        public Square​(SquareType type,
                      boolean northWall,
                      boolean southWall,
                      boolean westWall,
                      boolean eastWall)
        Constructor of Square on board.
        Parameters:
        type - Square is grass or star
        northWall - add north wall
        southWall - add south wall
        westWall - add west wall
        eastWall - add east wall
    • Method Detail

      • getType

        public SquareType getType()
        Simple getter of type
        Returns:
        type of Square
      • hasWall

        public boolean hasWall​(Direction direction)
        Verify if wall is present in given Direction
        Parameters:
        direction - Direction of wall
        Returns:
        true if wall is present, false if not
        Since:
        2.0.0
      • hasNorthWall

        public boolean hasNorthWall()
        this.northWall getter
        Returns:
        this.northWall
        Since:
        2.0.0
      • setNorthWall

        public void setNorthWall​(boolean northWall)
        this.northWall setter
        Parameters:
        northWall - New northWall value
        Since:
        2.0.0
      • hasSouthWall

        public boolean hasSouthWall()
        this.southWall getter
        Returns:
        this.southWall
        Since:
        2.0.0
      • setSouthWall

        public void setSouthWall​(boolean southWall)
        this.southWall setter
        Parameters:
        southWall - New southWall value
        Since:
        2.0.0
      • hasWestWall

        public boolean hasWestWall()
        this.westWall getter
        Returns:
        this.westWall
        Since:
        2.0.0
      • setWestWall

        public void setWestWall​(boolean westWall)
        this.westWall setter
        Parameters:
        westWall - New westWall value
        Since:
        2.0.0
      • hasEastWall

        public boolean hasEastWall()
        this.eastWall getter
        Returns:
        this.eastWall
        Since:
        2.0.0
      • setEastWall

        public void setEastWall​(boolean eastWall)
        this.eastWall setter
        Parameters:
        eastWall - New eastWall value
        Since:
        2.0.0