static public void Finished(ConstructionRequests req, NegroBundleOfSticks ship) { closed.Remove(req); unavailableConShips.Remove(ship); availableConShips.Add(ship); UpdateMissionsQuery(); }
static void AssignMission(ConstructionRequests conReq, NegroBundleOfSticks conShip) { opened.Remove(conReq); closed.Add(conReq); availableConShips.Remove(conShip); unavailableConShips.Add(conShip); conShip.AssignRequest(conReq); }
public static void UpdateMissionsQuery() { //to assign open construction request to avaailable conShips while (availableConShips.Count > 0 && opened.Count > 0) { NegroBundleOfSticks conShipZero = availableConShips[0]; List <ConstructionRequests> reqsts = new List <ConstructionRequests>(); reqsts.AddRange(opened); reqsts.OrderBy(targ => Vector3.Distance(conShipZero.transform.position, targ.constr.transform.position)).ToList(); //reqsts.AddRange(opened.OrderBy(targ => Vector3.Distance(conShipZero.transform.position, targ.constr.transform.position)).ToList()); AssignMission(reqsts[0], conShipZero); } }