Пример #1
0
 void SetFigureAt(Square square, Figure figure)
 {
     if (square.OnBoard())
     {
         figures[square.x, square.y] = figure;
     }
 }
Пример #2
0
 public Figure GetFigureAt(Square square)
 {
     if (square.OnBoard())
     {
         return(figures[square.x, square.y]);
     }
     return(Figure.none);
 }
Пример #3
0
        private bool CanStraightMove()
        {
            Square at = fm.from;

            do
            {
                at = new Square(at.x + fm.SignX, at.y + fm.SignY);
                if (at == fm.to)
                {
                    return(true);
                }
            } while (at.OnBoard() &&
                     board.GetFigureAt(at) == Figure.none);
            return(false);
        }