bool SearchTruck(GeoCoordinate coordinate) { foreach (Dump truck in Dumps.Where(x => x.Tod == TypeOfDump.Dumptruck)) { GeoCoordinate truckcoordinate = truck.Location; if (coordinate.GetDistanceTo(truckcoordinate) < LOADINGRADIUS && truck.CurrentState == "LL") { return(true); } } return(false); }
public int SearchExcavator(double latitude, double longitude) { GeoCoordinate coordinate = new GeoCoordinate(latitude, longitude, 0); foreach (Dump excav in Dumps.Where(x => x.Tod == TypeOfDump.Excavator)) { GeoCoordinate excavcoordinate = excav.Location; if (coordinate.GetDistanceTo(excavcoordinate) < LOADINGZONERADIUS) { return(excav.Id); } } return(-1); }
public int SearchTruck(double latitude, double longitude) { GeoCoordinate coordinate = new GeoCoordinate(latitude, longitude, 0); foreach (Dump truck in Dumps.Where(x => x.Tod == TypeOfDump.Dumptruck)) { GeoCoordinate truckcoordinate = truck.Location; if (coordinate.GetDistanceTo(truckcoordinate) < LOADINGRADIUS) { return(truck.Id); } } return(-1); }
public double SearchNearlyExcavator(int id) { double mindistance = double.MaxValue; GeoCoordinate coordinate = Dumps.Where(x => x.Id == id).Single().Location; foreach (Dump excav in Dumps.Where(x => x.Tod == TypeOfDump.Excavator)) { GeoCoordinate excavcoordinate = excav.Location; double dist = coordinate.GetDistanceTo(excavcoordinate); if (dist < mindistance) { mindistance = dist; } } return(mindistance); }