Ejemplo n.º 1
0
 private void TriggerHandler(FusionTrigger trigger)
 {
     if (User.IsCurrentProfileExist())
     {
         Fuse(trigger.priceName, trigger, trigger.fusionExecutions);
     }
 }
Ejemplo n.º 2
0
 private void FinishTrigger(FusionTrigger trigger, NPNFError error)
 {
     if (trigger != null)
     {
         trigger.FinishTriggeredAction(this, trigger, error);
     }
 }
Ejemplo n.º 3
0
        private void Fuse(string priceName, FusionTrigger trigger, List <FuseExecutions> executions)
        {
            if (!IsInitialized)
            {
                NPNFError error = NPNFError.GetGameError(NPNFError.GameCode.FUSION_NOT_INITIALIZED);
                if (OnFuseError != null)
                {
                    OnFuseError(this, trigger, error);
                }
                FinishTrigger(trigger, error);
                return;
            }

            User.CurrentProfile.Fusion.Fuse(Model.Name, priceName, executions, 1, (FormulaResult result, NPNFError error) =>
            {
                if (error == null)
                {
                    if (OnFuseDone != null)
                    {
                        OnFuseDone(this, trigger, result);
                    }
                }
                else
                {
                    if (OnFuseError != null)
                    {
                        OnFuseError(this, trigger, error);
                    }
                }
                FinishTrigger(trigger, error);
            });
        }
Ejemplo n.º 4
0
 protected abstract void FuseErrorHandler(Fusion fusion, FusionTrigger trigger, NPNFError error);
Ejemplo n.º 5
0
 protected abstract void FuseDoneHandler(Fusion fusion, FusionTrigger trigger, FormulaResult results);