Package net.royalur.model.shape
Class StandardBoardShape
java.lang.Object
net.royalur.model.shape.BoardShape
net.royalur.model.shape.StandardBoardShape
The standard shape of board used for The Royal Game of Ur that
follows the game boards that were excavated by Sir Leonard Woolley.
It has the following shape:
xxxx xx
xxxxxxxx
xxxx xx
-
Field Summary
Modifier and TypeFieldDescriptionThe set of all tiles that exist on the standard board.The set of rosette tiles that exist on the standard board. -
Constructor Summary
ConstructorDescriptionInstantiates the standard board shape used for the Royal Game of Ur. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whethertile
falls within this board shape.boolean
containsIndices
(int ix, int iy) Determines whether the tile at indices (ix
,iy
), 0-based, falls within the bounds of this shape of board.boolean
Determines whethertile
is a rosette tile in this board shape.boolean
isRosetteIndices
(int ix, int iy) Determines whether the tile at the indices (ix
,iy
), 0-based, is a rosette tile in this board shape.Methods inherited from class net.royalur.model.shape.BoardShape
containsAll, equals, getArea, getBoardType, getHeight, getID, getName, getRosetteTiles, getTiles, getTilesByColumn, getTilesByRow, getWidth, hasBoardType, isCompatible, isEquivalent
-
Field Details
-
BOARD_TILES
The set of all tiles that exist on the standard board. -
ROSETTE_TILES
The set of rosette tiles that exist on the standard board.
-
-
Constructor Details
-
StandardBoardShape
public StandardBoardShape()Instantiates the standard board shape used for the Royal Game of Ur.
-
-
Method Details
-
contains
Description copied from class:BoardShape
Determines whethertile
falls within this board shape.- Overrides:
contains
in classBoardShape
- Parameters:
tile
- The tile to be bounds-checked.- Returns:
- Whether the given tile falls within this board shape.
-
containsIndices
public boolean containsIndices(int ix, int iy) Description copied from class:BoardShape
Determines whether the tile at indices (ix
,iy
), 0-based, falls within the bounds of this shape of board.- Overrides:
containsIndices
in classBoardShape
- Parameters:
ix
- The x-index of the tile to be bounds-checked. This coordinate is 0-based.iy
- The y-index of the tile to be bounds-checked. This coordinate is 0-based.- Returns:
- Whether the given tile falls within the bounds of this shape of board.
-
isRosette
Description copied from class:BoardShape
Determines whethertile
is a rosette tile in this board shape.- Overrides:
isRosette
in classBoardShape
- Parameters:
tile
- The tile to check if it is a rosette.- Returns:
- Whether the given tile is a rosette tile on this board.
-
isRosetteIndices
public boolean isRosetteIndices(int ix, int iy) Description copied from class:BoardShape
Determines whether the tile at the indices (ix
,iy
), 0-based, is a rosette tile in this board shape.- Overrides:
isRosetteIndices
in classBoardShape
- Parameters:
ix
- The x-index of the tile to be checked for being a rosette. This coordinate is 0-based.iy
- The y-index of the tile to be checked for being a rosette. This coordinate is 0-based.- Returns:
- Whether the given tile is a rosette tile on this board.
-