コード例 #1
0
ファイル: Route.cs プロジェクト: nanduni-nin/SL-Route-
        public Boolean routeInContainsLocation(Location location) {

            foreach (Location loc in routeIn) {
                if (loc.getName().Equals(location.getName())) {
                    return true;
                }
            }
            return false;
        }
コード例 #2
0
ファイル: SearchRoute.cs プロジェクト: nanduni-nin/SL-Route-
        //Add the data into the data structures
        public static Route processInput(String temp, Route route) {
            Location location = null;
            String[] tempLocations = temp.Split(',');

            //fill the dictionarires for routes and locations
            foreach (String s in tempLocations) {
                if (!locations.ContainsKey(s)) {
                    location = new Location(s);
                    route.addLocationToRouteIn(location);
                    locations.Add(s, location);
                } else {
                    Location value;
                    if (locations.TryGetValue(s, out value)) {
                        route.addLocationToRouteIn(locations[s]);
                    }
                }
            }
            return route;
        }
コード例 #3
0
ファイル: Route.cs プロジェクト: nanduni-nin/SL-Route-
 public void addLocationToRouteOut(Location location) {
     routeOut.AddLast(location);
     location.addRoute(this);
 }