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
FieldsModifier 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
ConstructorsConstructorDescriptionInstantiates the standard board shape used for the Royal Game of Ur. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whethertilefalls within this board shape.booleancontainsIndices(int ix, int iy) Determines whether the tile at indices (ix,iy), 0-based, falls within the bounds of this shape of board.booleanDetermines whethertileis a rosette tile in this board shape.booleanisRosetteIndices(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:BoardShapeDetermines whethertilefalls within this board shape.- Overrides:
containsin 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:BoardShapeDetermines whether the tile at indices (ix,iy), 0-based, falls within the bounds of this shape of board.- Overrides:
containsIndicesin 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:BoardShapeDetermines whethertileis a rosette tile in this board shape.- Overrides:
isRosettein 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:BoardShapeDetermines whether the tile at the indices (ix,iy), 0-based, is a rosette tile in this board shape.- Overrides:
isRosetteIndicesin 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.
-