java.lang.Object
ru.hse.germandilio.tetris.server.generator.BricksRandomGenerator

public class BricksRandomGenerator extends Object
  • Constructor Details

    • BricksRandomGenerator

      public BricksRandomGenerator()
      Initialize brick generation and building bricks sequence.
  • Method Details

    • getBrick

      public boolean[][] getBrick(int indexInSequence)
      Get next brick in sequence by index.
      Parameters:
      indexInSequence - index
      Returns:
      Boolean matrix (brick). For converting to String use convertToString(boolean[][]).
    • convertToString

      public String convertToString(boolean[][] brick)
      Converts brick matrix of booleans to string representation fo zeros and ones.
      Parameters:
      brick - brick matrix
      Returns:
      String representation (ex. 1 0 1 0 0 0 0 ... 1)