[Implementation] Pentris – Piece
August 19, 2010 2 Comments
- TYPE enum: TYPE contains every possible type of piece in Tetris and Pentris. Also, a method to randomly select a type is implemented.
- Direction enum: Direction contains four possible directions of a move.
- Piece class: this models the data of Tetris and Pentris pieces
Piece class contains
- Static HashMap variables that are used to contain unchangeable data (color of a piece, coordinates (shape) of a piece, and min/max points for each type)
- x and y that record the center of a piece
- basic methods that a piece needs