예제 #1
0
        private void AddStudentToRoute(Route route, List <Student> students, Student student)
        {
            AddStudentToRoute(route, student);
            FindBestRouteForSchoolVan(route, students);
            IRouteObject routeObject = route.TheRoute.Last();

            route.RemoveLast();
        }
예제 #2
0
 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);
 }
예제 #3
0
 public int calculateDistanceObject(IRouteObject anObject, Coordinate actualCoordinate)
 {
     return(anObject.GetCoordinates().GetDistanceOf(actualCoordinate));
 }
예제 #4
0
        private void AddIntoRoute(Object anObject)
        {
            IRouteObject toAdd = anObject as IRouteObject;

            this.theRoute.Add(toAdd);
        }
예제 #5
0
 private bool AreSameType(IRouteObject item, IRouteObject anotherItem)
 {
     return(item.GetType().ToString().Equals(anotherItem.GetType().ToString()));
 }