/** * Coroutine à lancer pour découvrir la FreightArea de l'entrepôt le plus proche * capable d'accueillir le chargement passé en paramètre. **/ public IEnumerator FindNearestFreeWarehouseFor(ResourceShipment shipment, Cell <FreightAreaIn> rslt, HashSet <FreightAreaIn> toIgnore) { Cell <Warehouse> nearestFree = new Cell <Warehouse>(); Func <Warehouse, bool> acceptanceFunction = (Warehouse toTest) => toTest.orderManager.stock.stockLock.AvailableFor(shipment); yield return(StartCoroutine(StockManager.FindNearestWarehouseSatisfyingCondition(this, acceptanceFunction, nearestFree, toIgnore))); if (nearestFree.value != null) { rslt.value = nearestFree.value.orderManager.freightAreaData.freightAreaIn; } }