java.lang.Object
ru.hse.germandilio.tetris.client.model.gameboard.GameBoardUtils

public class GameBoardUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 place
      brickMatrix - matrix of brick
      xCoordinateCenter - X coordinate of figure center on board to place
      yCoordinateCenter - 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 place
      brickMatrix - matrix of brick
      xCoordinateCenter - X coordinate of figure center on board to place
      yCoordinateCenter - Y coordinate of figure center on board to place
      Returns:
      new gameBoard with placed brick.