Exemple #1
0
        /**/
        public Chess Move(string move)
        {
            FigureMoving fm = new FigureMoving(move);

            if (!moves.CanMove(fm))
            {
                return(this);
            }
            if (board.IsCheckAfterMove(fm))
            {
                return(this);
            }
            Board nextboard = board.Move(fm);
            Chess nextChess = new Chess(nextboard);

            return(nextChess);
        }
Exemple #2
0
        bool CanEatKing()
        {
            Square badKing = FindBadKing();
            Moves  moves   = new Moves(this);

            foreach (FigureOnSquare fs in YieldFigures())
            {
                FigureMoving fm = new FigureMoving(fs, badKing);
                if (moves.CanMove(fm))
                {
                    return(true);
                }
            }
            return(false);
        }