Table of Contents

Method TryDoAction

Namespace
GrindFest
Assembly
GrindFest.dll

TryDoAction(Func<ActionResult>, float)

Poll a bot API action like DoAction(string, Func<ActionResult>, float), but return instead of throwing.

protected IEnumerator TryDoAction(Func<ActionResult> action, float timeout)

Parameters

action Func<ActionResult>
timeout float

Returns

IEnumerator

Remarks

The same trap WaitUntil(string, Func<bool>, float, Func<string>) sets: it throws on timeout, so a caller that wants to explain WHY it gave up has nothing to report. Use this where the state at the moment of giving up is the answer - "the drink never finished" and "the drink was interrupted by a death" need completely different fixes, and DoAction renders them identical.