Пример #1
0
 public IEnumerable <FigureOnSquare> YieldFiguresOnSquares()
 {
     foreach (Square square in Square.YeildBoardSquares())
     {
         if (GetFigureAt(square).GetFigureColor() == MoveColor)
         {
             yield return(new FigureOnSquare(GetFigureAt(square), square));
         }
     }
 }
Пример #2
0
        public List <FigureOnSquare> GetFigureOnSquares()
        {
            var figuresOnSquares = new List <FigureOnSquare>();

            foreach (Square square in Square.YeildBoardSquares())
            {
                if (GetFigureAt(square).GetFigureColor() == MoveColor)
                {
                    figuresOnSquares.Add(new FigureOnSquare(GetFigureAt(square), square));
                }
            }

            return(figuresOnSquares);
        }