예제 #1
0
 public static bool CheckOverlap(AdhocBusGroup group1, AdhocBusGroup group2)
 {
     foreach (Bus bus in group1.Buses)
     {
         if (group2.Buses.Contains(bus))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
        public static AdhocBusGroup Merge(AdhocBusGroup group1, AdhocBusGroup group2)
        {
            List <Bus> buses = group1.Buses;

            foreach (Bus bus in group2.Buses)
            {
                if (!buses.Contains(bus))
                {
                    buses.Add(bus);
                }
            }

            return(new AdhocBusGroup(buses));
        }