next method

TetrominoType next()

Returns the next piece from the bag.

Implementation

TetrominoType next() {
  if (_bag.isEmpty) _refill();
  return _bag.removeAt(0);
}