示例#1
0
        public void Move(Position origin, Position destination)
        {
            var originBox      = this[origin];
            var destinationBox = this[destination];

            if (destinationBox.Piece != null)
            {
                CapturedPieceCollection.AddEntry(destinationBox.Piece);
            }

            destinationBox.Piece = originBox.Piece;
            originBox.Piece      = null;

            if (destinationBox.Piece is King)
            {
                UpdateKingPosition(destinationBox);
            }

            BeginPieceRecapturingIfPawnReachedTheEnd(destinationBox);

            if (!RetakingIsActive)
            {
                NextTurn();
            }

            // TODO: Maybe Handle history here
        }