Пример #1
0
 public Task HandleAsync(SetExpectedElementAction action, IDispatcher dispatcher)
 {
     Timer?.Dispose();
     Timer = new Timer(
         callback: _ =>
     {
         if (GameState.Value.ExpectedElement == action.AtomicNumber)
         {
             dispatcher.Dispatch(new RevealElementGroupAction(action.AtomicNumber));
         }
     },
         state: null,
         dueTime: DelayBeforeShowingElementGroupMS,
         period: 0);
     return(Task.CompletedTask);
 }
 public Task SetExpectedElementAction(SetExpectedElementAction _, IDispatcher dispatcher) =>
 AudioPlayer.PlayOneShotAsync(AudioSample.ElementAppeared);
 public static ElementsMatchGameState SetExpectedElementAction(ElementsMatchGameState state, SetExpectedElementAction action) =>