public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken) { await Activate(context, cancellationToken); await Dismiss(context, cancellationToken); return(true); }
public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken) { await Activate(context, cancellationToken); await context.ClickAt(DialogButton1, cancellationToken); var battle = new PrepareBattle(context); var ct = new CancellationTokenSource(TimeSpan.FromSeconds(3)); try { await battle.Activation(CancellationTokenSource.CreateLinkedTokenSource(ct.Token, cancellationToken).Token); } catch (TaskCanceledException) { //F**k, we've mistaken, it is a boss event! await context.ClickAt(600, 430, cancellationToken); var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)); try { await battle.Activation(CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, cts.Token).Token); } catch (TaskCanceledException) { await TryClose(context, cancellationToken); return(false); } } await battle.Engage(cancellationToken); await WaitCombatEnd(context, cancellationToken); return(true); }
public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken) { await Activate(context, cancellationToken); await context.ClickAt(DialogButton1, cancellationToken); return(true); }
public override Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken) => throw new NotImplementedException();
public abstract Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken);