private void AddStudentToRoute(Route route, List <Student> students, Student student) { AddStudentToRoute(route, student); FindBestRouteForSchoolVan(route, students); IRouteObject routeObject = route.TheRoute.Last(); route.RemoveLast(); }
private bool IsTheSameRoute(List <IRouteObject> list) { for (int i = 0; i < list.Count; i++) { IRouteObject item = list.ElementAt(i); if (!AreSameType(item, this.theRoute.ElementAt(i))) { return(false); } if (!item.GetCoordinates().Equals(this.theRoute.ElementAt(i).GetCoordinates())) { return(false); } } return(true); }
public int calculateDistanceObject(IRouteObject anObject, Coordinate actualCoordinate) { return(anObject.GetCoordinates().GetDistanceOf(actualCoordinate)); }
private void AddIntoRoute(Object anObject) { IRouteObject toAdd = anObject as IRouteObject; this.theRoute.Add(toAdd); }
private bool AreSameType(IRouteObject item, IRouteObject anotherItem) { return(item.GetType().ToString().Equals(anotherItem.GetType().ToString())); }