def setPieceCompleted(pieceIndex, bool)
      eachBlockInPiece(pieceIndex) do |blockIndex|
        if bool
          @completeBlocks.set blockIndex
        else
          @completeBlocks.clear blockIndex
        end
      end
      if bool
        @completePieces.set pieceIndex
      else
        @completePieces.clear pieceIndex
      end
    end
def setPieceCompleted(pieceIndex, bool)
      eachBlockInPiece(pieceIndex) do |blockIndex|
        if bool
          @completeBlocks.set blockIndex
        else
          @completeBlocks.clear blockIndex
        end
      end
      if bool
        @completePieces.set pieceIndex
      else
        @completePieces.clear pieceIndex
      end
    end
Set whether the piece is completed or not.