Ejemplo n.º 1
0
        public void AddPiece()
        {
            Piece     = NextPiece;
            NextPiece = PiecesCreator.GetPiece();

            var offsetRow = _topEdge - Piece.Top;
            var offsetCol = (Width - Piece.Width) / 2;

            foreach (var block in Piece.Blocks)
            {
                block.MoveByOffset(offsetRow, offsetCol);
            }

            Blocks.AddRange(Piece.Blocks);
        }
Ejemplo n.º 2
0
 public Board()
 {
     _topEdge  = Height - 1;
     NextPiece = PiecesCreator.GetPiece();
     Piece     = PiecesCreator.GetPiece();
 }