Ejemplo n.º 1
0
        private static IDrone DeliverOrder(IDeliverySettings deliverySettings, IDrone drone, IRoute route)
        {
            var baseDrone = drone;
            var newDrone  = drone.Deliver(route);

            if (IsOutOfReach(deliverySettings, newDrone.Position))
            {
                return(baseDrone);
            }
            return(newDrone);
        }