public async Task <PlayerUpdateResponse> Move(IGeoLocation targetLocation, Func <Task> functionExecutedWhileWalking, ISession session, CancellationToken cancellationToken, double customWalkingSpeed = 0.0) { cancellationToken.ThrowIfCancellationRequested(); // If the stretegies become bigger, create a factory for easy management return(await WalkStrategy.Walk(targetLocation, functionExecutedWhileWalking, session, cancellationToken, customWalkingSpeed)); }
public async Task Move(IGeoLocation targetLocation, Func <Task> functionExecutedWhileWalking, ISession session, CancellationToken cancellationToken, double customWalkingSpeed = 0.0) { cancellationToken.ThrowIfCancellationRequested(); TinyIoC.TinyIoCContainer.Current.Resolve <MultiAccountManager>().ThrowIfSwitchAccountRequested(); // If the stretegies become bigger, create a factory for easy management //Logging.Logger.Write($"Navigation - Walking speed {customWalkingSpeed}"); await WalkStrategy.Walk(targetLocation, functionExecutedWhileWalking, session, cancellationToken, customWalkingSpeed); }
public async Task Move(IGeoLocation targetLocation, Func <Task> functionExecutedWhileWalking, ISession session, CancellationToken cancellationToken, double customWalkingSpeed = 0.0) { distance = LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude, session.Client.CurrentLongitude, targetLocation.Latitude, targetLocation.Longitude); cancellationToken.ThrowIfCancellationRequested(); TinyIoC.TinyIoCContainer.Current.Resolve <MultiAccountManager>().ThrowIfSwitchAccountRequested(); // If the stretegies become bigger, create a factory for easy management //Logging.Logger.Write($"Navigation - Walking speed {customWalkingSpeed}"); InitializeWalkStrategies(session.LogicSettings); WalkStrategy = GetStrategy(session.LogicSettings); await WalkStrategy.Walk(targetLocation, functionExecutedWhileWalking, session, cancellationToken, customWalkingSpeed).ConfigureAwait(false); }