Class BricksRandomGenerator
java.lang.Object
ru.hse.germandilio.tetris.server.generator.BricksRandomGenerator
-
Constructor Summary
ConstructorDescriptionInitialize brick generation and building bricks sequence. -
Method Summary
Modifier and TypeMethodDescriptionconvertToString
(boolean[][] brick) Converts brick matrix of booleans to string representation fo zeros and ones.boolean[][]
getBrick
(int indexInSequence) Get next brick in sequence by index.
-
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
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)
-