Package g54327.humbug.model.Squares
Class Square
- java.lang.Object
-
- g54327.humbug.model.Squares.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 Summary
Constructors Constructor Description Square()ConstructorSquare(SquareType type)Constructor of Square on board.Square(SquareType type, boolean northWall, boolean southWall, boolean westWall, boolean eastWall)Constructor of Square on board.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SquareTypegetType()Simple getter of typebooleanhasEastWall()this.eastWall getterbooleanhasNorthWall()this.northWall getterbooleanhasSouthWall()this.southWall getterbooleanhasWall(Direction direction)Verify if wall is present in given DirectionbooleanhasWestWall()this.westWall gettervoidsetEastWall(boolean eastWall)this.eastWall settervoidsetNorthWall(boolean northWall)this.northWall settervoidsetSouthWall(boolean southWall)this.southWall settervoidsetWestWall(boolean westWall)this.westWall setter
-
-
-
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 starnorthWall- add north wallsouthWall- add south wallwestWall- add west walleastWall- 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
-
-