package tetris; import java.awt.Point; import java.util.*; public class TetrisPiece { // The block which should be used to paint this piece. private TetrisBlock block; // List of offsets from (0,0) where blocks of this piece lie. private List offsets; // Size of the bounding box square around this piece. private int pieceSize; /** Construct a new TetrisPiece */ private TetrisPiece(TetrisBlock block, List offsets, int pieceSize) { this.block = block; this.offsets = offsets; this.pieceSize = pieceSize; } /** Construct a new TetrisPiece given a block, point offsets * and piece bounding box size. **/ public TetrisPiece(TetrisBlock block, Point[] offsets, int pieceSize) { this.block = block; this.offsets = new ArrayList(); for (int i=0; i