コード例 #1
0
ファイル: Chess.cs プロジェクト: PeterChernykh/PetProjectRepo
        void FindAllMoves()
        {
            allPossibleMoves = new List <FigureMoving>();

            foreach (FigureOnSquare fs in board.YieldFigures())
            {
                foreach (Square to in Square.YieldSquares())
                {
                    FigureMoving fm = new FigureMoving(to, fs);
                    if (moves.CanMove(fm))
                    {
                        if (!board.IsCheckAfterMove(fm))
                        {
                            allPossibleMoves.Add(fm);
                        }
                    }
                }
            }
        }