private bool HasMoves(Location to, Location @from, Cell old) { var hasMoves = false; board.Set(to, board.Get(@from)); board.Set(@from, Cell.Empty); if (!IsCheck()) hasMoves = true; board.Set(@from, board.Get(to)); board.Set(to, old); return hasMoves; }
public Move(Board board, Location from, Location to, Cell oldDestinationCell) { this.board = board; this.from = from; this.to = to; this.oldDestinationCell = oldDestinationCell; }
public void Set(Location location, Cell cell) { cells[location.X, location.Y] = cell; }