public void Load(UXMLElement element) { items.Clear(); foreach (UXMLElement itemElement in element.Elements("item")) { InventoryItem item = new InventoryItem(); item.Load(itemElement); if (item.count > 0 && item.data != null) { /* * if(items.ContainsKey(item.data.type)) { * items[item.data.type][item.id] = item; * } else { * items.Add(item.data.type, new Dictionary<string, InventoryItem> { * [item.id] = item * }); * }*/ AddItemImpl(item); } else { // Debug.Log($"Inventory: ITEM DATA COUNT OR DATA NULL {item.count} - {item.data}".Colored(ColorType.red)); } } }
public void Load(UXMLElement element) { rooms.Clear(); foreach (UXMLElement roomElement in element.Elements("room")) { RoomInfo roomInfo = new RoomInfo(); roomInfo.Load(roomElement); rooms[roomInfo.id] = roomInfo; } }
public override void Load(UXMLElement element) { base.Load(element); rankDescriptionId = element.GetString("rank_description"); tiers = new List <AchievmentTierData>(); element.Elements("rank").ForEach(rankElement => { AchievmentTierData tierData = new AchievmentTierData(); tierData.Load(rankElement); tiers.Add(tierData); }); }
public void Load(UXMLElement element) { buffs.Clear(); foreach (UXMLElement buffElement in element.Elements("buff")) { BuffInfo buff = new BuffInfo(); buff.Load(buffElement); if (buff.IsValid) { buffs.Add(buff.Id, buff); } } isLoaded = true; }
public void Load(UXMLElement element) { collectables.Clear(); foreach (UXMLElement itemElement in element.Elements("item")) { string id = itemElement.GetString("id"); InventoryItemType type = itemElement.GetEnum <InventoryItemType>("type"); InventoryItemData data = resourceService.GetInventoryItemData(type, id); if (data != null) { collectables[data.id] = data; } } }
public override void Load(UXMLElement element) { base.Load(element); type = element.GetEnum <QuestType>("type"); ownerId = element.GetString("owner"); startTextId = element.GetString("start_text"); hintTextId = element.GetString("hint_text"); endTextId = element.GetString("end_text"); journalId = element.GetString("journal"); startConditions = new List <Condition>(); UXMLElement scParentElement = element.Element("start_conditions"); if (scParentElement != null) { scParentElement.Elements("condition").ForEach(e => { startConditions.Add(Condition.FromXml(e)); }); } completeConditions = new List <Condition>(); UXMLElement ccParentElement = element.Element("complete_conditions"); if (ccParentElement != null) { ccParentElement.Elements("condition").ForEach(e => { completeConditions.Add(Condition.FromXml(e)); }); } rewards = new List <DropItem>(); UXMLElement rewardsParentElement = element.Element("rewards"); rewardsParentElement.Elements("reward").ForEach(e => { rewards.Add(new DropItem(e)); }); }