public bool WouldLeaveInCheck(Move moveOriginal, Side side) { Board future = Board.DeepCopy(); //Move moveTested = moveOriginal.DeepCopy(future); Move moveTested = new Move(future[moveOriginal.From], moveOriginal.To, future, true); future.Moves.Add(moveTested); moveTested.DoMove(); return(future.IsInCheck(side)); }
public virtual void AppendCheckNotation() { if (Board.CheckIfMated(Piece.Side.Opposite()) == Piece.Side.GetVictoryStatus()) { NotationAlgebraic += "#"; NotationEnglish += "mate"; } else if (Board.IsInCheck(Piece.Side.Opposite())) { NotationAlgebraic += "+"; NotationEnglish += "ch"; } }
public override void AppendCheckNotation() { NotationAlgebraic += Promotion.Abbreviation(); NotationPGN += "=" + Promotion.Abbreviation(); NotationEnglish += "(" + Promotion.Abbreviation(true) + ")"; base.AppendCheckNotation(); if (Board.CheckIfMated(Piece.Side.Opposite()) == Piece.Side.GetVictoryStatus()) { NotationPGN += "#"; } else if (Board.IsInCheck(Piece.Side.Opposite())) { NotationPGN += "+"; } }