Exemplo n.º 1
0
            public override void OnStateEnter()
            {
                base.OnStateEnter();

                UpdateBalanceSignal.Fire(SignalBus).Done(() =>
                {
                    SetBalanceSignal.Fire(SignalBus)
                    .Done(() =>
                    {
                        // TODO: Decide what to Do. For Now just getting on the start again.

                        Observable.Timer(TimeSpan.FromSeconds(Settings.ResultVisibilityTime))
                        .Subscribe(l => Model.RouletteState = ERouletteState.Setup)
                        .AddTo(Disposables);
                    },
                          exception =>
                    {
                        // TODO: Do something...
                        Debug.LogError($"Error: Something went wrong. {exception}");
                    });
                },
                                                         exception =>
                {
                    Debug.LogError($"Error: Something went wrong. {exception}");
                });
            }
Exemplo n.º 2
0
        public static IPromise Fire(SignalBus signalBus)
        {
            UpdateBalanceSignal signal = new UpdateBalanceSignal();

            signalBus.Fire(signal);
            return(signal.FireInternal());
        }
Exemplo n.º 3
0
 public void Execute(UpdateBalanceSignal signal)
 {
     if (_rouletteModel.UpdateBalanceWithMultiplier())
     {
         signal.Resolve();
     }
     else
     {
         signal.Reject(new Exception("Unable to update balance."));
     }
 }