public Task <bool> RemoveTag(PocketItem item, string tag, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
 public Task <bool> Delete(PocketItem item, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
 public Task <bool> AddTags(PocketItem item, string[] tags, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
Example #4
0
    public void DisplayEquipment(Equipment equip, GameObject obj)
    {
        GameObject[] r = GameObject.FindGameObjectsWithTag("Respawn");

        for (int i = 0; i < r.Length; i++)
        {
            Destroy(r[i]);
        }


        int itemQuantity = 0;

        for (int i = 0; i < GameManager.Instance.Inventory.EquipmentPocket.items.Count; i++)
        {
            PocketItem p = GameManager.Instance.Inventory.EquipmentPocket.items[i];
            if (p.itemName == equip.itemName)
            {
                itemQuantity += 1;
            }
        }
        //GameObject item = Instantiate(equip.equip.equipPrefab, transform.position, Quaternion.identity);
        GameObject item = Instantiate(obj, transform.position, Quaternion.identity);

        item.transform.SetParent(transform);
        item.GetComponentInChildren <TMP_Text>().text = "";
        item.transform.position = new Vector3(itemSprite.transform.position.x, itemSprite.transform.position.y, -2f);
        //item.transform.localScale = new Vector3(item.transform.localScale.x * 2f, item.transform.localScale.y * 2f, 1f);
        //item.GetComponent<SpriteRenderer>().sortingLayerName = "PopMenu";
        item.tag = "Respawn";

        //itemSprite.GetComponent<SpriteRenderer>().sprite = equip.GetComponent<Image>().sprite;
        nameText.text = equip.itemName;
        typeText.text = equip.equipClass.ToString();

        //if the item doesn't have a required time, or doesn't even list one, check for that
        if (equip.typeMonsterReq != "")
        {
            typeReqText.text = "Required Type: " + equip.typeMonsterReq;
        }
        else
        {
            typeReqText.text = "Required Type: none";
        }

        boostsText.text = equip.equipment.description;
        //yourQuantityText.text = "On hand: " + PlayerPrefs.GetInt(equip.itemName).ToString();
        yourQuantityText.text = "On hand: " + itemQuantity;
        buyCostText.text      = "Buy For: " + equip.cost.ToString();

        float sellValue = equip.cost * .8f;

        sellCostText.text = "Sell For: " + sellValue;

        activeItemName = equip.itemName;
        activeItem     = obj;

        itemBuyValue  = (int)equip.cost;
        itemSellValue = (int)sellValue;

        PriceCheck();
    }
 public void SetInventorySlot(PocketItem e)
 {
     inventorySlot = e;
     exp           = e.itemExp;
     level         = e.itemLevel;
 }
Example #6
0
    //use this to show the equipment items you have in your inventory
    void DisplayYourEquipment()
    {
        //var equips = GameManager.Instance.items.equipment;
        var allEquips  = GameManager.Instance.items.allEquipsDict;
        var yourEquips = GameManager.Instance.GetComponent <YourItems>().yourEquipment;
        var allCells   = GameManager.Instance.items.allMonsterCellsDict;
        //var allConsumables = GameManager.Instance.items.allConsumablesDict;
        int   row      = 0;
        float rowCheck = 0f;

        for (int i = 0; i < GameManager.Instance.Inventory.EquipmentPocket.items.Count; i++)
        {
            PocketItem p = GameManager.Instance.Inventory.EquipmentPocket.items[i];
            //EquipmentScript item = Instantiate(allEquips[p.itemName]);
            Equipment item = new Equipment(allEquips[p.itemName]);
            //set the item to match the slot in the inventory
            item.SetInventorySlot(p);
            //change the item's stats to match its level
            item.GetStats();
            int itemCount = PlayerPrefs.GetInt(item.itemName);

            GameObject a = Instantiate(equipmentObject, itemSprite.transform.position, Quaternion.identity);


            //a.GetComponent<EquipmentObject>().equipment.info.
            a.transform.SetParent(itemScrollContent.transform, true);

            a.GetComponent <EquipmentObject>().equipment = item;
            a.GetComponent <EquipmentObject>().LoadItem(item);
            //a.GetComponentInChildren<TMP_Text>().text = PlayerPrefs.GetInt(item.name).ToString();
            a.GetComponentInChildren <TMP_Text>().text = "Lv: " + p.itemLevel;
            a.transform.position   = new Vector3(itemSprite.transform.position.x + ((rowCheck * 4) * itemScrollContent.GetComponent <RectTransform>().rect.width / 6), itemSprite.transform.position.y - (row * 35), itemSprite.transform.position.z);
            a.transform.localScale = new Vector3(a.transform.localScale.x * 1.5f, a.transform.localScale.y * 1.5f, 1f);
            a.tag  = "Item";
            a.name = p.itemName;
            item.equipment.ActivateItem(item.equipment, a);

            rowCheck += .25f;

            if (rowCheck > .8f)
            {
                rowCheck = 0f;
                row     += 1;
            }
        }

        //foreach (KeyValuePair<string, int> equip in yourEquips)
        //{
        //    string name = equip.Key;

        //    //Debug.Log(name);

        //    //if the player has more than 0 of the item, display it
        //    if (equip.Value > 0)
        //    {

        //        EquipmentScript item = allEquips[name];
        //        int itemCount = PlayerPrefs.GetInt(item.name);

        //        GameObject a = Instantiate(equipmentObject, itemSprite.transform.position, Quaternion.identity);



        //        a.transform.SetParent(itemScrollContent.transform, true);

        //        a.GetComponent<EquipmentObject>().equipment = item;
        //        a.GetComponent<EquipmentObject>().LoadItem(item);
        //        //a.GetComponentInChildren<TMP_Text>().text = PlayerPrefs.GetInt(item.name).ToString();
        //        a.GetComponentInChildren<TMP_Text>().text = equip.Value.ToString();
        //        a.transform.position = new Vector3(itemSprite.transform.position.x + ((rowCheck * 4) * itemScrollContent.GetComponent<RectTransform>().rect.width / 6), itemSprite.transform.position.y - (row * 35), itemSprite.transform.position.z);
        //        a.transform.localScale = new Vector3(a.transform.localScale.x * 1.5f, a.transform.localScale.y * 1.5f, 1f);
        //        a.tag = "Item";
        //        a.name = item.name;
        //        item.ActivateItem(item, a);

        //        rowCheck += .25f;

        //        if (rowCheck > .8f)
        //        {
        //            rowCheck = 0f;
        //            row += 1;
        //        }
        //    }

        //}
    }
Example #7
0
    //use this to show the consumable items you have in your inventory
    void DisplayYourConsumables()
    {
        var   consumables = GameManager.Instance.GetComponent <YourAccount>().yourItems.yourConsumables;
        var   allCons     = GameManager.Instance.items.allConsumablesDict;
        int   row         = 0;
        float rowCheck    = 0f;

        for (int i = 0; i < GameManager.Instance.Inventory.ConsumablePocket.items.Count; i++)
        {
            PocketItem     item      = GameManager.Instance.Inventory.ConsumablePocket.items[i];
            ConsumableItem cItem     = Instantiate(allCons[item.itemName]);
            int            itemCount = PlayerPrefs.GetInt(cItem.name);
            cItem.inventorySlot = item;

            GameObject a = Instantiate(consumableObject, itemScrollContent.transform.position, Quaternion.identity);


            //itemQuantities[shopSpriteTotal] = itemSprites[shopSpriteTotal].GetComponentInChildren<TMP_Text>();
            a.transform.SetParent(itemScrollContent.transform, true);


            a.GetComponent <ConsumableObject>().consumableItem = cItem;
            a.GetComponent <ConsumableObject>().LoadItem();
            a.GetComponentInChildren <TMP_Text>().text = "";
            a.transform.position   = new Vector3(itemSprite.transform.position.x + ((rowCheck * 4) * itemScrollContent.GetComponent <RectTransform>().rect.width / 6), itemSprite.transform.position.y - (row * 35), itemSprite.transform.position.z);
            a.transform.localScale = new Vector3(a.transform.localScale.x * 1.5f, a.transform.localScale.y * 1.5f, 1f);
            a.tag  = "Item";
            a.name = cItem.name;


            rowCheck += .25f;

            if (rowCheck > .8f)
            {
                rowCheck = 0f;
                row     += 1;
            }
        }


        //foreach (KeyValuePair<string, int> item in consumables)
        //{
        //    if (consumables.ContainsKey(item.Key))
        //    {

        //        string name = item.Key;

        //        //if the player has more than 0 of the item, display it
        //        if (item.Value > 0)
        //        {

        //            ConsumableItem cItem = allCons[item.Key];
        //            int itemCount = PlayerPrefs.GetInt(cItem.name);

        //            GameObject a = Instantiate(consumableObject, itemScrollContent.transform.position, Quaternion.identity);


        //            //itemQuantities[shopSpriteTotal] = itemSprites[shopSpriteTotal].GetComponentInChildren<TMP_Text>();
        //            a.transform.SetParent(itemScrollContent.transform, true);


        //            a.GetComponent<ConsumableObject>().consumableItem = cItem;
        //            a.GetComponent<ConsumableObject>().LoadItem();
        //            a.GetComponentInChildren<TMP_Text>().text = PlayerPrefs.GetInt(item.Key).ToString();
        //            a.transform.position = new Vector3(itemSprite.transform.position.x + ((rowCheck * 4) * itemScrollContent.GetComponent<RectTransform>().rect.width / 6), itemSprite.transform.position.y - (row * 35), itemSprite.transform.position.z);
        //            a.transform.localScale = new Vector3(a.transform.localScale.x * 1.5f, a.transform.localScale.y * 1.5f, 1f);
        //            a.tag = "Item";
        //            a.name = cItem.name;


        //            rowCheck += .25f;

        //            if (rowCheck > .8f)
        //            {
        //                rowCheck = 0f;
        //                row += 1;
        //            }
        //        }
        //    }
        //}
    }
Example #8
0
 /// <summary>
 /// Removes a tag from an item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="tag">The tag.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task <bool> RemoveTag(PocketItem item, string tag, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await RemoveTag(item.ID, tag, cancellationToken));
 }
Example #9
0
 /// <summary>
 /// Favorites the specified item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task <bool> Favorite(PocketItem item, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await Favorite(item.ID, cancellationToken));
 }
Example #10
0
 /// <summary>
 /// Adds the specified tags to an item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="tags">The tags.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task <bool> AddTags(PocketItem item, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await AddTags(item.ID, tags, cancellationToken));
 }
Example #11
0
 public Item(PocketItem pocketItem)
 {
     PocketItem = pocketItem;
     Title      = pocketItem.Title;
 }
Example #12
0
        public async Task DeleteArticleAsync(PocketItem pocketItem)
        {
            await _pocketClient.DeletePocketItemAsync(pocketItem);

            await SyncArticlesAsync();
        }
Example #13
0
        public async Task AddArticleAsync(Uri uri)
        {
            PocketItem pocketItem = await _pocketClient.AddPocketItemAsync(uri);

            await SyncArticlesAsync();
        }
Example #14
0
        private async Task TestDeleteAsync(PocketItem pocketItem)
        {
            bool result = await _pocketClient.DeletePocketItemAsync(pocketItem);

            Assert.AreEqual(true, result);
        }