public bool CheckPath(CarData car) { try { if (car.mapID == null) { return(false); } return(car.mapID.CheckPath(car)); } catch { return(false); } }
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); }
public void setCarMap(CarData car, MapData map) { car.mapID = map; map.Cars.Add(car); inMapCar.Add(car); }
public void addCar(CarData car) { CarList.Add(car); }