void SetFigureAt(Square square, Figure figure) { if (square.IsOnBoard()) { Figures[square.X, square.Y] = figure; } }
public Figure GetFigureAt(Square square) { Figure figureAt = Figure.none; if (square.IsOnBoard()) { figureAt = Figures[square.X, square.Y]; } return(figureAt); }
bool CanMoveStraight() { Square from = fm.From; do { from = new Square(from.X + fm.SignX, from.Y + fm.SignY); if (from == fm.To) { return(true); } }while (from.IsOnBoard() && board.GetFigureAt(from) == Figure.none); return(false); }