Example #1
0
 public bool CheckPath(CarData car)
 {
     try
     {
         if (car.mapID == null)
         {
             return(false);
         }
         return(car.mapID.CheckPath(car));
     }
     catch { return(false); }
 }
Example #2
0
 public bool CheckPath(CarData car)
 {
     if (Handle == null)
     {
         return(false);
     }
     if (car.TargetNodeID == 255)
     {
         car.TargetNodeID = car.nowNodeID;
     }
     byte[] usenodesid = Handle.getTargetPointList(Handle[car.TargetNodeID], Handle[car.nowNodeID]);
     if (usenodesid == null)
     {
         return(false);
     }
     foreach (CarData c in Cars)
     {
         if (car == c)
         {
             continue;
         }
         if (c.TargetNodeID == 255)
         {
             c.TargetNodeID = c.nowNodeID;
         }
         byte[] pathuse = Handle.getTargetPointList(Handle[c.TargetNodeID], Handle[c.nowNodeID]);
         if (pathuse == null)
         {
             return(false);
         }
         for (int i = 0; i < usenodesid.Length; i++)
         {
             if ((usenodesid[i] + pathuse[i]) >= 2)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Example #3
0
 public void setCarMap(CarData car, MapData map)
 {
     car.mapID = map;
     map.Cars.Add(car);
     inMapCar.Add(car);
 }
Example #4
0
 public void addCar(CarData car)
 {
     CarList.Add(car);
 }