decideTap static method

TapDecision decideTap({
  1. required bool gameVisible,
  2. bool isLiveTest = false,
  3. required ChanceGranted? chance,
})

A tap opens the stored chance, unless a game is already showing. A live-test tap is not busy: the open replaces the visible game.

Implementation

static TapDecision decideTap({
  required bool gameVisible,
  bool isLiveTest = false,
  required ChanceGranted? chance,
}) {
  if (gameVisible && !isLiveTest) return const TapFail(failBusy);
  if (chance == null) return const TapFail(failMissingConfig);
  return TapOpen(chance);
}