private void CreateBoard() { for (var i = 0; i < MAX_LINES; i++) { var line = new PiecesLine(i, (i % 2 != 0), i == 0); var lineAmount = MAX_PIECES_PER_LINE - (line.IsShortLine ? 1 : 0); for (var j = 0; j < lineAmount; j++) { var pieceToAdd = i < INITIAL_LINE_AMOUNT?NormalPiece.GetRandom() : null; pieceToAdd?.UpdatePosition(line, j); pieceToAdd?.Lock(); line.Add(pieceToAdd); } lines.Add(line); } UpdateConnections(); Dump(); }
public Piece GetNextPiece() { var piece = NormalPiece.GetRandom(); return(piece); }