Example #1
0
        // For realize moving
        public Board Move(FigureMoving fm)
        {
            var next = new Board(Fen);

            next.SetFigureAt(fm.From, Figure.none);
            next.SetFigureAt(fm.To, CheckingOnPromotion(fm));

            ChangingMoveNumberAndFlipColor(next);
            next.GenerateFen();
            return(next);
        }
Example #2
0
        public Board Move(FigureMoving fm)
        {
            Board next = new Board(fen);

            next.SetFigureAt(fm.from, Figure.none);
            next.SetFigureAt(fm.to, fm.promotion == Figure.none ? fm.figure : fm.promotion);
            if (moveColor == Color.black)
            {
                next.moveNumber++;
            }
            next.moveColor = moveColor.FlipColor();
            next.GenerateFen();
            return(next);
        }
Example #3
0
        public Board Move(FigureMoving fm)//реализация самого хода фигуры
        {
            Board next = new Board(fen);

            next.SetFigureAt(fm.from, Figure.none);
            next.SetFigureAt(fm.to, fm.promotion == Figure.none ? fm.figure : fm.promotion);
            if (moveColor == Color.black)
            {
                next.moveNumber++;
            }
            next.moveColor = moveColor.FlipColor();
            next.GenerateFen(); //для сохранения ходов всех фигур
            return(next);
        }
Example #4
0
        public Board Move(FigureMoving fm)
        {
            Board next = new Board(Fen);

            next.SetFigureAt(fm.From, Figure.None);
            next.SetFigureAt(fm.To, fm.Promotion == Figure.None ? fm.Figure : fm.Promotion);
            if (MoveColor == Color.Black)
            {
                next.MoveNumber++;
            }

            next.MoveColor = MoveColor.FlipColor();
            next.GenerateFen();
            return(next);
        }