Ejemplo n.º 1
0
    public void CheckRecipe()
    {
        Recipe recipe = FindReadyRecipe();

        if (recipe != null)
        {
            GameObject obj = GameObject.Find("CollectionCore");
            collectionCore = obj.GetComponent <CollectionCore>();

            Dictionary <string, ConversionFormula> formulas = collectionCore.GetFormulas();
            ConversionFormula formulaToUse = formulas [recipe.formulaName];

            User.CurrentProfile.Entitlements.ApplyConversion(formulaToUse.Id, (ConversionResult result, NPNFError error) => {
                if (error == null)
                {
                    InventoryController ctrler = (InventoryController)AppController.Instance.GetController(Controller.INVENTORY);

                    foreach (Entitlement entitlement in result.Added)
                    {
                        ctrler.OnNewInventory(entitlement.Id);
                    }
                    recipe.isDone = true;
                }
                else if (error != null)
                {
                    Debug.LogError("Conversion failed" + error);
                    AppController.Instance.IsNetworkError(error);
                }
            });
        }
    }
Ejemplo n.º 2
0
 public static void RevertChangesToDBValue <T>(this CollectionCore <T> entityCollection) where T : class, IEntity
 {
     foreach (var dirtyEntity in entityCollection.DirtyEntities)
     {
         dirtyEntity.RevertChangesToDBValue();
     }
 }
Ejemplo n.º 3
0
    void Awake()
    {
        GameObject obj = GameObject.Find("CollectionCore");

        collectionCore        = obj.GetComponent <CollectionCore>();
        pendingEntitlementIds = new List <string>();
    }
Ejemplo n.º 4
0
    void Awake()
    {
        text.text = "";
        gameObject.SetActive(false);
        isShown = false;
        GameObject obj = GameObject.Find("CollectionCore");

        collectionCore = obj.GetComponent <CollectionCore>();
    }
Ejemplo n.º 5
0
 public bool Remove(T item)
 {
     return(CollectionCore.Remove(item));
 }