void SetFigureAt(Square square, Figure figure) { if (square.onBoard()) { figures[square.x, square.y] = figure; } }
public Figure GetFigureAt(Square square) { if (square.onBoard()) { return(figures[square.x, square.y]); } return(Figure.none); }
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); }