Class GameBoardUtils
java.lang.Object
ru.hse.germandilio.tetris.client.model.gameboard.GameBoardUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
intersects
(boolean[][] gameBoard, boolean[][] brickMatrix, int xCoordinateCenter, int yCoordinateCenter) Checks if possible to place brick on board.static boolean[][]
locateToGameBoard
(boolean[][] gameBoard, boolean[][] brickMatrix, int xCoordinateCenter, int yCoordinateCenter) Locate brick on board
-
Constructor Details
-
GameBoardUtils
public GameBoardUtils()
-
-
Method Details
-
intersects
public static boolean intersects(boolean[][] gameBoard, boolean[][] brickMatrix, int xCoordinateCenter, int yCoordinateCenter) Checks if possible to place brick on board.- Parameters:
gameBoard
- gameBoard to placebrickMatrix
- matrix of brickxCoordinateCenter
- X coordinate of figure center on board to placeyCoordinateCenter
- Y coordinate of figure center on board to place- Returns:
- true - if possible. Otherwise, false.
-
locateToGameBoard
public static boolean[][] locateToGameBoard(boolean[][] gameBoard, boolean[][] brickMatrix, int xCoordinateCenter, int yCoordinateCenter) Locate brick on board- Parameters:
gameBoard
- gameBoard to placebrickMatrix
- matrix of brickxCoordinateCenter
- X coordinate of figure center on board to placeyCoordinateCenter
- Y coordinate of figure center on board to place- Returns:
- new gameBoard with placed brick.
-