public int get(IShortestPathSearch shortestPath, string start, string destination) { Node nodeStart; Node nodeDestination; try { nodeStart = RailRoad.getNode(char.Parse(start)); nodeDestination = RailRoad.getNode(char.Parse(destination)); } catch (FormatException formatException) { Logger.error(formatException.Message); throw formatException; } catch (Exception exception) { Logger.fatal(exception.Message); throw exception; } return(shortestPath.find(RailRoad, nodeStart, nodeDestination)); }
public int get(IBreadthFirstSearch searchMechanism, string start, string destination, int valueLimit) { Node nodeStart; Node nodeDestination; try { nodeStart = RailRoad.getNode(char.Parse(start)); nodeDestination = RailRoad.getNode(char.Parse(destination)); } catch (FormatException formatException) { Logger.error(formatException.Message); throw formatException; } catch (Exception exception) { Logger.fatal(exception.Message); throw exception; } return(searchMechanism.find(nodeStart, nodeDestination, valueLimit)); }