示例#1
0
文件: Move.cs 项目: SARyther/WpfChess
        public virtual void Execute()
        {
            //Promotion
            if (CanPieceBePromoted())
            {
                OnInitiatePawnPromotion?.Invoke(start, new EventArgs());
            }

            var lostPiece = board.ShiftPiece(start, end);

            start.IsFirstMove = false;
            if (lostPiece != null)
            {
                OnPieceCaptured?.Invoke(lostPiece, new EventArgs());
            }
        }
示例#2
0
 private void Move_OnInitiatePawnPromotion(object sender, EventArgs e)
 {
     OnInitiatePawnPromotion?.Invoke(sender, e);
 }