ChessDotNet.Variants.Atomic.AtomicChessGame.WouldBeSuicide C# (CSharp) Method

WouldBeSuicide() protected method

protected WouldBeSuicide ( Move move, Player player ) : bool
move Move
player Player
return bool
        protected virtual bool WouldBeSuicide(Move move, Player player)
        {
            ChessUtilities.ThrowIfNull(move, "move");
            AtomicChessGame copy = new AtomicChessGame(Board, player);
            copy.ApplyMove(move, true);
            bool ownKingIsGone = copy.KingIsGone(player);
            if (ownKingIsGone)
            {
                return true;
            }
            else
            {
                return false;
            }
        }