示例#1
0
        /// <summary>
        /// Transfers the contents from this cell to another.
        /// </summary>
        /// <param name="to">The transfer destination.</param>
        /// <remarks>
        /// <para>
        /// If this cell is empty, an InvalidOperationException will be thrown.
        /// </para>
        /// <para>
        /// If the destination cell is not empty, an InvalidOperationException
        /// will be thrown.
        /// </para>
        /// </remarks>
        public void MoveContent(BoardCell to)
        {
            ErrorIfEmpty();
            var content = GetContent();

            SetContent(null);
            to.SetContent(content);
        }