コード例 #1
0
        internal static CashEffect Parse(WZProperty wZProperty)
        {
            CashEffect effect = new CashEffect();

            bool isOnlyDefault = false;

            effect.isFollow = wZProperty.ResolveFor <bool>("follow") ?? false;

            foreach (WZProperty obj in wZProperty.Children.Where(c => c.NameWithoutExtension != "follow" && c.NameWithoutExtension != "info"))
            {
                int frameTest = 0;
                if (isOnlyDefault = (obj.Type == PropertyType.Canvas || int.TryParse(obj.NameWithoutExtension, out frameTest)))
                {
                    break;
                }

                if (obj.Children.Count() == 0)
                {
                    continue;
                }
                effect.framebooks.Add(obj.NameWithoutExtension, FrameBook.Parse(obj));
            }

            if (isOnlyDefault)
            {
                effect.framebooks.Add("default", FrameBook.Parse(wZProperty));
            }

            return(effect);
        }
コード例 #2
0
ファイル: Cash.cs プロジェクト: steven1152/maplestory.io
        public static Cash Parse(WZProperty stringWz)
        {
            int id;

            if (!int.TryParse(stringWz.NameWithoutExtension, out id))
            {
                return(null);
            }

            Cash item = new Cash(id);

            WZProperty itemWz = stringWz.ResolveOutlink($"Item/Cash/{id.ToString("D8").Substring(0, 4)}.img/{id.ToString("D8")}");

            if (itemWz != null)
            {
                item.MetaInfo = ItemInfo.Parse(itemWz);
                item.effect   = CashEffect.Parse((itemWz?.Resolve("effect") ?? itemWz));
            }
            item.Description = ItemDescription.Parse(stringWz, id);

            return(item);
        }