public override void SetFlexibleCounter(ItemInformationData itemInformation, string newTitle = "")
    {
        base.SetFlexibleCounter(itemInformation, newTitle);

        switch (itemInformation.ItemType)
        {
        case ItemType.Resources:
            equipmentPanel.SetActive(false);
            descriptionPanel.SetActive(true);

            descriptionText.text = itemInformation.itemDescription;
            break;

        case ItemType.Equipment:
            equipmentPanel.SetActive(true);
            descriptionPanel.SetActive(false);

            equipmentCounterList[0].text = itemInformation.health.ToString();
            equipmentCounterList[1].text = itemInformation.damage.ToString();
            equipmentCounterList[2].text = itemInformation.speed.ToString();
            equipmentCounterList[3].text = itemInformation.durability.ToString();
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
        public void ExtractAspectDataFromEcoData(EconomyRequestFacade ecoData, string branchKey)
        {
            var targetDic = this.EconomyTierListOverview[branchKey];

            foreach (var keyValuePair in ecoData.EconomyTierlistOverview[branchKey])
            {
                var baseType       = keyValuePair.Key;
                var sourceItemList = keyValuePair.Value;

                if (!targetDic.ContainsKey(baseType))
                {
                    targetDic.Add(baseType, new List <ItemInformationData>());
                }

                var targetItems = targetDic[baseType];

                foreach (var sourceItem in sourceItemList)
                {
                    var targetItem = targetItems.FirstOrDefault(x => x.Name == sourceItem.Name);
                    if (targetItem == null)
                    {
                        targetItem = new ItemInformationData
                        {
                            Name     = sourceItem.Name,
                            BaseType = sourceItem.BaseType,
                            Special  = sourceItem.Variant
                        };

                        targetItems.Add(targetItem);
                    }

                    targetItem.Aspects = new List <IItemAspect>(sourceItem.Aspects);
                }
            }
        }
Exemplo n.º 3
0
        public static IEnumerable <ItemInformationData> ParseItemInformationString(string input)
        {
            dynamic jsonObj = JsonConvert.DeserializeObject <dynamic>(input, new JsonSerializerSettings()
            {
                CheckAdditionalContent = true
            });

            if (jsonObj == null)
            {
                yield break;
            }

            foreach (JObject job in jsonObj.lines)
            {
                ItemInformationData nItem = new ItemInformationData();
                JsonConvert.PopulateObject(job.ToString(), nItem);
                yield return(nItem);
            }
        }
Exemplo n.º 4
0
        public void ExtractAspectDataFromEcoData(EconomyRequestFacade ecoData, string branchKey)
        {
            var targetDic = this.EconomyTierListOverview[branchKey];

            foreach (var keyValuePair in ecoData.EconomyTierlistOverview[branchKey])
            {
                var baseType       = keyValuePair.Key;
                var sourceItemList = keyValuePair.Value;

                if (!targetDic.ContainsKey(baseType))
                {
                    targetDic.Add(baseType, new List <ItemInformationData>());
                }

                var targetItems = targetDic[baseType];

                foreach (var sourceItem in sourceItemList.GroupBy(x => x.Name).Select(x => x.OrderByDescending(y => y.CVal).First()))
                {
                    var targetItem = targetItems.Where(x => x.Equals(sourceItem)).ToList();
                    if (targetItem.Count == 0)
                    {
                        var item = new ItemInformationData
                        {
                            Name     = sourceItem.Name,
                            BaseType = sourceItem.BaseType,
                            Special  = sourceItem.Variant
                        };

                        targetItem.Add(item);
                        targetItems.Add(item);
                    }

                    targetItem.ForEach(x => x.Aspects = new List <IItemAspect>(sourceItem.Aspects));
                }
            }
        }
Exemplo n.º 5
0
 public virtual void SetFlexibleCounter(ItemInformationData itemInformation, string newTitle = "")
 {
 }