public void Load(XmlNode node) { ID = node.Attributes["id"].Value; Image = node.Attributes["image"].Value; Event = bool.Parse(node.Attributes["event"].Value); Target = new pd_GoodsData(); Target.goods_type = (pe_GoodsType)Enum.Parse(typeof(pe_GoodsType), node.Attributes["goods_type"].Value); Target.goods_value = int.Parse(node.Attributes["goods_value"].Value); Price = new pd_GoodsData(); Price.goods_type = (pe_GoodsType)Enum.Parse(typeof(pe_GoodsType), node.Attributes["price_type"].Value); Price.goods_value = int.Parse(node.Attributes["price"].Value); bonus = int.Parse(node.Attributes["bonus"].Value); limit = short.Parse(node.Attributes["limit"].Value); string item_id = node.Attributes["need_ticket"].Value; if (string.IsNullOrEmpty(item_id) == false) { NeedItem = ItemInfoManager.Instance.GetInfoByID(item_id) as ItemInfo; } else { NeedItem = null; } mileage = int.Parse(node.Attributes["mileage"].Value); refresh_free = int.Parse(node.Attributes["refresh_free"].Value); refresh_count = int.Parse(node.Attributes["refresh_count"].Value); }
protected override void PostLoadData(XmlNode node) { base.PostLoadData(node); XmlNode info_node = node.SelectSingleNode("Info"); Title = info_node.Attributes["title"].Value; Desc = info_node.Attributes["desc"].Value; InstantCompletePeriod = int.Parse(info_node.Attributes["instant_complete_period"].Value); Price = new pd_GoodsData(); Price.goods_type = (pe_GoodsType)Enum.Parse(typeof(pe_GoodsType), info_node.Attributes["price_type"].Value); Price.goods_value = int.Parse(info_node.Attributes["price_value"].Value); foreach (var info in m_Infos) { foreach (var condition in info.Conditions) { if (condition != null) { condition.SetConditionText(); } } } }
public void Load(XmlNode node) { ID = node.Attributes["id"].Value; Image = node.Attributes["image"].Value; LootType = node.Attributes["loot_type"].Value; Name = node.Attributes["name"].Value; LootCount = int.Parse(node.Attributes["loot_count"].Value); Price = new pd_GoodsData(); Price.goods_type = (pe_GoodsType)Enum.Parse(typeof(pe_GoodsType), node.Attributes["price_type"].Value); Price.goods_value = int.Parse(node.Attributes["price"].Value); refresh_free = short.Parse(node.Attributes["refresh_free"].Value); refresh_count = short.Parse(node.Attributes["refresh_count"].Value); XmlAttribute desc_top_attr = node.Attributes["desc_top"]; if (desc_top_attr != null) { DescTop = desc_top_attr.Value; } XmlAttribute desc_bottom_attr = node.Attributes["desc_bottom"]; if (desc_bottom_attr != null) { DescBottom = desc_bottom_attr.Value; } }
public StoreConfirmParam(Rune rune, RuneType type, pd_GoodsData goods, OnOkDeleage _del, bool is_event) { title = rune.GetName(); this.icon_id = goods.goods_type.ToString(); this.price = goods.goods_value; rune_item = rune; message = Localization.Get(type + "Confirm"); OnOk = _del; this.is_event = is_event; }
public StoreConfirmParam(pd_GoodsData goods, string refresh_icon, OnOkDeleage _del = null) { title = Localization.Get("StoreRefreshTitle"); refresh_goods = goods; this.icon_id = goods.goods_type.ToString(); this.price = goods.goods_value; message = Localization.Get("StoreRefreshMessage"); this.refresh_icon = refresh_icon; OnOk = _del; }
override public void Load(XmlNode node) { base.Load(node); IconID = node.Attributes["icon_id"].Value; StoreType = (pe_StoreType)Enum.Parse(typeof(pe_StoreType), node.Attributes["store_type"].Value); Enable = bool.Parse(node.Attributes["enable"].Value); DescID = node.Attributes["desc_id"].Value; switch (StoreType) { case pe_StoreType.Loot: m_LootItem = new List <StoreLootItem>(); foreach (XmlNode itemNode in node.SelectNodes("Item")) { m_LootItem.Add(new StoreLootItem(itemNode, ID)); } break; case pe_StoreType.Goods: m_GoodsItem = new List <StoreGoodsItem>(); foreach (XmlNode itemNode in node.SelectNodes("Item")) { m_GoodsItem.Add(new StoreGoodsItem(itemNode, ID)); } break; default: break; } //refresh time item XmlNode refresh_node = node.SelectSingleNode("Refresh"); if (refresh_node != null) { m_RefreshTimes = new List <short>(); foreach (XmlNode time_node in refresh_node.ChildNodes) { m_RefreshTimes.Add(short.Parse(time_node.Attributes["hour"].Value)); } RefreshPrice = new pd_GoodsData(); RefreshPrice.goods_type = (pe_GoodsType)Enum.Parse(typeof(pe_GoodsType), refresh_node.Attributes["price_type"].Value); RefreshPrice.goods_value = int.Parse(refresh_node.Attributes["price_value"].Value); } }
public bool UseGoods(pd_GoodsData goods) { return UseGoodsValue(goods.goods_type, goods.goods_value); }
public void AddGoods(pd_GoodsData goods) { AddGoodsValue(goods.goods_type, goods.goods_value); }