Esempio n. 1
0
        public FieldStringTemplate(int id, IDataProperty property)
        {
            ID = id;

            MapName    = property.ResolveOrDefault <string>("mapName") ?? "NO-NAME";
            StreetName = property.ResolveOrDefault <string>("streetName");
        }
Esempio n. 2
0
        public static CommodityTemplate Parse(int id, IDataProperty property)
        {
            var t = new CommodityTemplate {
                ID = id
            };

            property.Resolve(p =>
            {
                t.ItemID         = p.Resolve <int>("ItemId") ?? 0;
                t.Count          = p.Resolve <short>("Count") ?? 1;
                t.Priority       = p.Resolve <byte>("Priority") ?? 0;
                t.Price          = p.Resolve <int>("Price") ?? 0;
                t.Bonus          = p.Resolve <byte>("Bonus") ?? 0;
                t.Period         = p.Resolve <short>("Period") ?? 0;
                t.ReqPOP         = p.Resolve <short>("ReqPOP") ?? 0;
                t.ReqLEV         = p.Resolve <short>("ReqLEV") ?? 0;
                t.MaplePoint     = p.Resolve <int>("MaplePoint") ?? 0;
                t.Meso           = p.Resolve <int>("Meso") ?? 0;
                t.ForPremiumUser = p.Resolve <bool>("Premium") ?? false;
                t.Gender         = p.Resolve <sbyte>("Gender") ?? 0;
                t.OnSale         = p.Resolve <bool>("OnSale") ?? false;
                t.Class          = p.Resolve <byte>("Class") ?? 0;
                t.Limit          = p.Resolve <byte>("Limit") ?? 0;
                t.PbCash         = p.Resolve <short>("PbCash") ?? 0;
                t.PbPoint        = p.Resolve <short>("PbPoint") ?? 0;
                t.PbGift         = p.Resolve <short>("PbGift") ?? 0;
            });

            return(t);
        }
Esempio n. 3
0
        public ContinentTemplate(int id, IDataProperty property)
        {
            ID = id;

            Info = property.ResolveOrDefault <string>("info");

            property.Resolve("field").ResolveAll(f =>
            {
                StartShipMoveFieldID = f.Resolve <int>("startShipMoveFieldID") ?? 999999999;
                WaitFieldID          = f.Resolve <int>("waitFieldID") ?? 999999999;
                MoveFieldID          = f.Resolve <int>("moveFieldID") ?? 999999999;
                CabinFieldID         = f.Resolve <int>("cabinFieldID");
                EndFieldID           = f.Resolve <int>("endFieldID") ?? 999999999;
                EndShipMoveFieldID   = f.Resolve <int>("endShipMoveFieldID") ?? 999999999;
            });

            property.Resolve("scheduler").ResolveAll(s =>
            {
                Term  = s.Resolve <int>("tTerm") ?? 1;
                Delay = s.Resolve <int>("tDelay") ?? 0;
            });

            property.Resolve("genMob")?.ResolveAll(g =>
                                                   GenMob = new ContinentGenMobTemplate(0, g.ResolveAll())
                                                   );

            Event = GenMob != null;

            property.Resolve("time").ResolveAll(t =>
            {
                Wait     = t.Resolve <int>("tWait") ?? 1;
                EventEnd = t.Resolve <int>("tEventEnd") ?? 0;
                Required = t.Resolve <int>("tRequired") ?? 0;
            });
        }
        public static SetItemEffectTemplate Parse(int id, IDataProperty property)
        {
            var t = new SetItemEffectTemplate {
                ID = id
            };

            property.Resolve(p =>
            {
                t.IncSTR   = p.Resolve <short>("incSTR") ?? 0;
                t.IncDEX   = p.Resolve <short>("incDEX") ?? 0;
                t.IncINT   = p.Resolve <short>("incINT") ?? 0;
                t.IncLUK   = p.Resolve <short>("incLUK") ?? 0;
                t.IncMaxHP = p.Resolve <short>("incMHP") ?? 0;
                t.IncMaxMP = p.Resolve <short>("incMMP") ?? 0;
                t.IncPAD   = p.Resolve <short>("incPAD") ?? 0;
                t.IncMAD   = p.Resolve <short>("incMAD") ?? 0;
                t.IncPDD   = p.Resolve <short>("incPDD") ?? 0;
                t.IncMDD   = p.Resolve <short>("incMDD") ?? 0;
                t.IncACC   = p.Resolve <short>("incACC") ?? 0;
                t.IncEVA   = p.Resolve <short>("incEVA") ?? 0;
                t.IncCraft = p.Resolve <short>("incCraft") ?? 0;
                t.IncSpeed = p.Resolve <short>("incSpeed") ?? 0;
                t.IncJump  = p.Resolve <short>("incJump") ?? 0;
            });
            return(t);
        }
Esempio n. 5
0
        public SkillStringTemplate(int id, IDataProperty property)
        {
            ID = id;

            Name = property.ResolveOrDefault <string>("name") ?? "NO-NAME";
            Desc = property.ResolveOrDefault <string>("desc");
        }
Esempio n. 6
0
 public DataValue(string id, string dataRowId, string propertyId, object value, IDataRow dataRow, IDataProperty property) :
     base(id, dataRowId, dataRow)
 {
     PropertyId = propertyId;
     Value      = value;
     Property   = property;
 }
        public static ItemOptionLevelTemplate Parse(int id, IDataProperty property)
        {
            var t = new ItemOptionLevelTemplate {
                ID = id
            };

            property.Resolve(p =>
            {
                t.Prob     = p.Resolve <int>("prop") ?? 0;
                t.Time     = p.Resolve <int>("time") ?? 0;
                t.IncSTR   = p.Resolve <short>("incSTR") ?? 0;
                t.IncDEX   = p.Resolve <short>("incDEX") ?? 0;
                t.IncINT   = p.Resolve <short>("incINT") ?? 0;
                t.IncLUK   = p.Resolve <short>("incLUK") ?? 0;
                t.IncHP    = p.Resolve <int>("incHP") ?? 0;
                t.IncMP    = p.Resolve <int>("incMP") ?? 0;
                t.IncACC   = p.Resolve <short>("incACC") ?? 0;
                t.IncEVA   = p.Resolve <short>("incEVA") ?? 0;
                t.IncSpeed = p.Resolve <short>("incSpeed") ?? 0;
                t.IncJump  = p.Resolve <short>("incJump") ?? 0;
                t.IncMaxHP = p.Resolve <short>("incMHP") ?? 0;
                t.IncMaxMP = p.Resolve <short>("incMMP") ?? 0;
                t.IncPAD   = p.Resolve <short>("incPAD") ?? 0;
                t.IncMAD   = p.Resolve <short>("incMAD") ?? 0;
                t.IncPDD   = p.Resolve <short>("incPDD") ?? 0;
                t.IncMDD   = p.Resolve <short>("incMDD") ?? 0;

                t.IncSTRr   = p.Resolve <short>("incSTRr") ?? 0;
                t.IncDEXr   = p.Resolve <short>("incDEXr") ?? 0;
                t.IncINTr   = p.Resolve <short>("incINTr") ?? 0;
                t.IncLUKr   = p.Resolve <short>("incLUKr") ?? 0;
                t.IncACCr   = p.Resolve <short>("incACCr") ?? 0;
                t.IncEVAr   = p.Resolve <short>("incEVAr") ?? 0;
                t.IncMaxHPr = p.Resolve <short>("incMHPr") ?? 0;
                t.IncMaxMPr = p.Resolve <short>("incMMPr") ?? 0;
                t.IncPADr   = p.Resolve <short>("incPADr") ?? 0;
                t.IncMADr   = p.Resolve <short>("incMADr") ?? 0;
                t.IncPDDr   = p.Resolve <short>("incPDDr") ?? 0;
                t.IncMDDr   = p.Resolve <short>("incMDDr") ?? 0;

                t.IncCr           = p.Resolve <short>("incCr") ?? 0;
                t.IncAllSkill     = p.Resolve <short>("incAllskill") ?? 0;
                t.RecoveryHP      = p.Resolve <short>("RecoveryHP") ?? 0;
                t.RecoveryMP      = p.Resolve <short>("RecoveryMP") ?? 0;
                t.RecoveryUP      = p.Resolve <short>("RecoveryUP") ?? 0;
                t.MPConReduce     = p.Resolve <short>("mpconReduce") ?? 0;
                t.MPConRestore    = p.Resolve <short>("mpRestore") ?? 0;
                t.IgnoreTargetDEF = p.Resolve <short>("ignoreTargetDEF") ?? 0;
                t.IgnoreDAM       = p.Resolve <short>("ignoreDAM") ?? 0;
                t.IgnoreDAMr      = p.Resolve <short>("ignoreDAMr") ?? 0;
                t.IncDAMr         = p.Resolve <short>("incDAMr") ?? 0;
                t.DAMReflect      = p.Resolve <short>("DAMreflect") ?? 0;
                t.AttackType      = p.Resolve <short>("attackType") ?? 0;
                t.IncMesoProb     = p.Resolve <int>("incMesoProp") ?? 0;
                t.IncRewardProb   = p.Resolve <int>("incRewardProp") ?? 0;
                t.Level           = p.Resolve <short>("level") ?? 0;
                t.Boss            = p.Resolve <short>("boss") ?? 0;
            });
            return(t);
        }
Esempio n. 8
0
 public CashPackageTemplate(int id, IDataProperty property)
 {
     ID        = id;
     PackageSN = property.Resolve("SN").Children
                 .Select(c => c.Resolve <int>() ?? 0)
                 .ToArray();
 }
        public ModifiedCommodityTemplate(int id, IDataProperty property)
        {
            ID = id;

            ItemID         = property.Resolve <int>("itemId");
            Count          = property.Resolve <short>("count");
            Priority       = property.Resolve <byte>("priority");
            Price          = property.Resolve <int>("price");
            Bonus          = property.Resolve <byte>("bonus");
            Period         = property.Resolve <short>("period");
            ReqPOP         = property.Resolve <short>("reqPOP");
            ReqLEV         = property.Resolve <short>("reqLEV");
            MaplePoint     = property.Resolve <int>("maplePoint");
            Meso           = property.Resolve <int>("meso");
            ForPremiumUser = property.Resolve <bool>("premium");
            Gender         = property.Resolve <byte>("gender");
            OnSale         = property.Resolve <bool>("onSale");
            Class          = property.Resolve <byte>("class");
            Limit          = property.Resolve <byte>("limit");
            PbCash         = property.Resolve <short>("pbCash");
            PbPoint        = property.Resolve <short>("pbPoint");
            PbGift         = property.Resolve <short>("pbGift");
            PackageSN      = property.Resolve("package")?.Children
                             .Select(c => c.Resolve <int>() ?? 0)
                             .ToArray();
        }
Esempio n. 10
0
        public MobTemplate(int id, IDataProperty property)
        {
            ID = id;

            if (property.Resolve("fly") != null)
            {
                MoveAbility = MoveAbilityType.Fly;
            }
            else if (property.Resolve("jump") != null)
            {
                MoveAbility = MoveAbilityType.Jump;
            }
            else if (property.Resolve("move") != null)
            {
                MoveAbility = MoveAbilityType.Walk;
            }
            else
            {
                MoveAbility = MoveAbilityType.Stop;
            }

            Level = property.Resolve <short>("info/level") ?? 0;
            EXP   = property.Resolve <int>("info/exp") ?? 0;
            MaxHP = property.Resolve <int>("info/maxHP") ?? 1;
            MaxMP = property.Resolve <int>("info/maxMP") ?? 0;
        }
        public static ModifiedCommodityTemplate Parse(int id, IDataProperty property)
        {
            var t = new ModifiedCommodityTemplate {
                ID = id
            };

            property.Resolve(p =>
            {
                t.ItemID         = p.Resolve <int>("itemId");
                t.Count          = p.Resolve <short>("count");
                t.Priority       = p.Resolve <byte>("priority");
                t.Price          = p.Resolve <int>("price");
                t.Bonus          = p.Resolve <byte>("bonus");
                t.Period         = p.Resolve <short>("period");
                t.ReqPOP         = p.Resolve <short>("reqPOP");
                t.ReqLEV         = p.Resolve <short>("reqLEV");
                t.MaplePoint     = p.Resolve <int>("maplePoint");
                t.Meso           = p.Resolve <int>("meso");
                t.ForPremiumUser = p.Resolve <bool>("premium");
                t.Gender         = p.Resolve <byte>("gender");
                t.OnSale         = p.Resolve <bool>("onSale");
                t.Class          = p.Resolve <byte>("class");
                t.Limit          = p.Resolve <byte>("limit");
                t.PbCash         = p.Resolve <short>("pbCash");
                t.PbPoint        = p.Resolve <short>("pbPoint");
                t.PbGift         = p.Resolve <short>("pbGift");
                t.PackageSN      = property.Resolve("package")?.Children
                                   .Select(c => c.Resolve <int>() ?? 0)
                                   .ToArray() ?? null;
            });

            return(t);
        }
Esempio n. 12
0
        public SkillLevelTemplate(int id, int skillID, IDataProperty property, bool resolveExpression = true)
        {
            ID      = id;
            SkillID = skillID;

            if (resolveExpression)
            {
                var x = new Argument("x", id);

                var u = new Function("u", "ceil(x)", "x");
                var d = new Function("d", "floor(x)", "x");

                HP    = ResolveExpression(property.ResolveOrDefault <string>("hp"), x, u, d);
                MP    = ResolveExpression(property.ResolveOrDefault <string>("mp"), x, u, d);
                PAD   = ResolveExpression(property.ResolveOrDefault <string>("pad"), x, u, d);
                PDD   = ResolveExpression(property.ResolveOrDefault <string>("pdd"), x, u, d);
                MAD   = ResolveExpression(property.ResolveOrDefault <string>("mad"), x, u, d);
                MDD   = ResolveExpression(property.ResolveOrDefault <string>("mdd"), x, u, d);
                ACC   = ResolveExpression(property.ResolveOrDefault <string>("acc"), x, u, d);
                EVA   = ResolveExpression(property.ResolveOrDefault <string>("eva"), x, u, d);
                Craft = ResolveExpression(property.ResolveOrDefault <string>("craft"), x, u, d);
                Speed = ResolveExpression(property.ResolveOrDefault <string>("speed"), x, u, d);
                Jump  = ResolveExpression(property.ResolveOrDefault <string>("jump"), x, u, d);
                Morph = ResolveExpression(property.ResolveOrDefault <string>("morph"), x, u, d);
                Time  = ResolveExpression(property.ResolveOrDefault <string>("time"), x, u, d);
                X     = ResolveExpression(property.ResolveOrDefault <string>("x"), x, u, d);
                Y     = ResolveExpression(property.ResolveOrDefault <string>("y"), x, u, d);
                Z     = ResolveExpression(property.ResolveOrDefault <string>("z"), x, u, d);
                EMHP  = ResolveExpression(property.ResolveOrDefault <string>("emhp"), x, u, d);
                EMMP  = ResolveExpression(property.ResolveOrDefault <string>("emmp"), x, u, d);
                EPAD  = ResolveExpression(property.ResolveOrDefault <string>("epad"), x, u, d);
                EMAD  = ResolveExpression(property.ResolveOrDefault <string>("emad"), x, u, d);
                EPDD  = ResolveExpression(property.ResolveOrDefault <string>("epdd"), x, u, d);
                EMDD  = ResolveExpression(property.ResolveOrDefault <string>("emdd"), x, u, d);
                return;
            }

            HP    = (short)(property.Resolve <int>("hp") ?? 0);
            MP    = (short)(property.Resolve <int>("mp") ?? 0);
            PAD   = (short)(property.Resolve <int>("pad") ?? 0);
            PDD   = (short)(property.Resolve <int>("pdd") ?? 0);
            MAD   = (short)(property.Resolve <int>("mad") ?? 0);
            MDD   = (short)(property.Resolve <int>("mdd") ?? 0);
            ACC   = (short)(property.Resolve <int>("acc") ?? 0);
            EVA   = (short)(property.Resolve <int>("eva") ?? 0);
            Craft = (short)(property.Resolve <int>("craft") ?? 0);
            Speed = (short)(property.Resolve <int>("speed") ?? 0);
            Jump  = (short)(property.Resolve <int>("jump") ?? 0);
            Morph = (short)(property.Resolve <int>("morph") ?? 0);
            Time  = (short)(property.Resolve <int>("time") ?? 0);
            X     = (short)(property.Resolve <int>("x") ?? 0);
            Y     = (short)(property.Resolve <int>("y") ?? 0);
            Z     = (short)(property.Resolve <int>("z") ?? 0);
            EMHP  = (short)(property.Resolve <int>("emhp") ?? 0);
            EMMP  = (short)(property.Resolve <int>("emmp") ?? 0);
            EPAD  = (short)(property.Resolve <int>("epad") ?? 0);
            EMAD  = (short)(property.Resolve <int>("emad") ?? 0);
            EPDD  = (short)(property.Resolve <int>("epdd") ?? 0);
            EMDD  = (short)(property.Resolve <int>("emdd") ?? 0);
        }
Esempio n. 13
0
        public BestTemplate(int id, IDataProperty property)
        {
            ID = id;

            Category    = Convert.ToInt32(property.Parent.Parent.Name);
            Gender      = property.Parent.Name == "male" ? 0 : 1;
            CommoditySN = property.Resolve <int>() ?? 0;
        }
Esempio n. 14
0
        public NPCScriptTemplate(IDataProperty property)
        {
            ID = Convert.ToInt32(property.Name);

            Script = property.ResolveOrDefault <string>("script");
            Start  = property.Resolve <int>("start") ?? 0;
            End    = property.Resolve <int>("end") ?? 0;
        }
Esempio n. 15
0
        public CategoryDiscountTemplate(int id, IDataProperty property)
        {
            ID = id;

            Category     = Convert.ToByte(property.Parent.Name);
            CategorySub  = Convert.ToByte(property.Name);
            DiscountRate = property.Resolve <byte>() ?? 0;
        }
Esempio n. 16
0
 public NPCShopTemplate(int id, IDataProperty property)
 {
     ID    = id;
     Items = property.Children
             .ToImmutableDictionary(
         c => Convert.ToInt32(c.Name),
         c => new NPCShopItemTemplate(Convert.ToInt32(c.Name), c.ResolveAll())
         );
 }
Esempio n. 17
0
        public override void Parse(int id, IDataProperty p)
        {
            p.Resolve("info").Resolve(info =>
            {
                base.Parse(id, info);

                Life = info.Resolve <short>("life") ?? -1;
            });
        }
Esempio n. 18
0
        public QuestOperationTemplate(int id, IDataProperty property)
        {
            ID = id;

            Items = property.Resolve("item")?.Children
                    .Select(c => new QuestItemEntry(c.ResolveAll()))
                    .ToImmutableList()
                    ?? ImmutableList <QuestItemEntry> .Empty;
        }
Esempio n. 19
0
        public static NotSaleTemplate Parse(int id, IDataProperty property)
        {
            var t = new NotSaleTemplate
            {
                ID = id
            };

            return(t);
        }
Esempio n. 20
0
 public static CashPackageTemplate Parse(int id, IDataProperty property)
 {
     return(new CashPackageTemplate
     {
         ID = id,
         PackageSN = property.Resolve("SN").Children
                     .Select(c => c.Resolve <int>() ?? 0)
                     .ToArray()
     });
 }
Esempio n. 21
0
        public override void Parse(int id, IDataProperty p)
        {
            p.Resolve("info").Resolve(info =>
            {
                base.Parse(id, info);

                UnitPrice  = info.Resolve <double>("unitPrice") ?? 0.0;
                MaxPerSlot = info.Resolve <short>("slotMax") ?? 100;
            });
        }
Esempio n. 22
0
        public RewardTemplate(int id, IDataProperty property)
        {
            ID = id;

            Entries = property.Children
                      .Select(c => new RewardEntryTemplate(
                                  Convert.ToInt32(c.Name),
                                  c.ResolveAll()))
                      .ToImmutableList();
        }
Esempio n. 23
0
        public ContinentGenMobTemplate(int id, IDataProperty property)
        {
            ID = id;

            TemplateID = property.Resolve <int>("genMobItemID") ?? 0;
            Position   = new Point(
                property.Resolve <int>("genMobPosition_x") ?? 0,
                property.Resolve <int>("genMobPosition_y") ?? 0
                );
        }
Esempio n. 24
0
 public FieldFootholdTemplate(IDataProperty property)
 {
     ID   = Convert.ToInt32(property.Name);
     Next = property.Resolve <int>("next") ?? 0;
     Prev = property.Resolve <int>("prev") ?? 0;
     X1   = property.Resolve <int>("x1") ?? 0;
     X2   = property.Resolve <int>("x2") ?? 0;
     Y1   = property.Resolve <int>("y1") ?? 0;
     Y2   = property.Resolve <int>("y2") ?? 0;
 }
Esempio n. 25
0
        public ItemOptionLevelTemplate(int id, IDataProperty property)
        {
            ID = id;

            Prob = property.Resolve <int>("prop") ?? 0;
            Time = property.Resolve <int>("time") ?? 0;

            IncSTR   = property.Resolve <short>("incSTR") ?? 0;
            IncDEX   = property.Resolve <short>("incDEX") ?? 0;
            IncINT   = property.Resolve <short>("incINT") ?? 0;
            IncLUK   = property.Resolve <short>("incLUK") ?? 0;
            IncHP    = property.Resolve <int>("incHP") ?? 0;
            IncMP    = property.Resolve <int>("incMP") ?? 0;
            IncACC   = property.Resolve <short>("incACC") ?? 0;
            IncEVA   = property.Resolve <short>("incEVA") ?? 0;
            IncSpeed = property.Resolve <short>("incSpeed") ?? 0;
            IncJump  = property.Resolve <short>("incJump") ?? 0;
            IncMaxHP = property.Resolve <short>("incMHP") ?? 0;
            IncMaxMP = property.Resolve <short>("incMMP") ?? 0;
            IncPAD   = property.Resolve <short>("incPAD") ?? 0;
            IncMAD   = property.Resolve <short>("incMAD") ?? 0;
            IncPDD   = property.Resolve <short>("incPDD") ?? 0;
            IncMDD   = property.Resolve <short>("incMDD") ?? 0;

            IncSTRr   = property.Resolve <short>("incSTRr") ?? 0;
            IncDEXr   = property.Resolve <short>("incDEXr") ?? 0;
            IncINTr   = property.Resolve <short>("incINTr") ?? 0;
            IncLUKr   = property.Resolve <short>("incLUKr") ?? 0;
            IncACCr   = property.Resolve <short>("incACCr") ?? 0;
            IncEVAr   = property.Resolve <short>("incEVAr") ?? 0;
            IncMaxHPr = property.Resolve <short>("incMHPr") ?? 0;
            IncMaxMPr = property.Resolve <short>("incMMPr") ?? 0;
            IncPADr   = property.Resolve <short>("incPADr") ?? 0;
            IncMADr   = property.Resolve <short>("incMADr") ?? 0;
            IncPDDr   = property.Resolve <short>("incPDDr") ?? 0;
            IncMDDr   = property.Resolve <short>("incMDDr") ?? 0;

            IncCr           = property.Resolve <short>("incCr") ?? 0;
            IncAllSkill     = property.Resolve <short>("incAllskill") ?? 0;
            RecoveryHP      = property.Resolve <short>("RecoveryHP") ?? 0;
            RecoveryMP      = property.Resolve <short>("RecoveryMP") ?? 0;
            RecoveryUP      = property.Resolve <short>("RecoveryUP") ?? 0;
            MPConReduce     = property.Resolve <short>("mpconReduce") ?? 0;
            MPConRestore    = property.Resolve <short>("mpRestore") ?? 0;
            IgnoreTargetDEF = property.Resolve <short>("ignoreTargetDEF") ?? 0;
            IgnoreDAM       = property.Resolve <short>("ignoreDAM") ?? 0;
            IgnoreDAMr      = property.Resolve <short>("ignoreDAMr") ?? 0;
            IncDAMr         = property.Resolve <short>("incDAMr") ?? 0;
            DAMReflect      = property.Resolve <short>("DAMreflect") ?? 0;
            AttackType      = property.Resolve <short>("attackType") ?? 0;
            IncMesoProb     = property.Resolve <int>("incMesoProp") ?? 0;
            IncRewardProb   = property.Resolve <int>("incRewardProp") ?? 0;
            Level           = property.Resolve <short>("level") ?? 0;
            Boss            = property.Resolve <short>("boss") ?? 0;
        }
        public GeneralDataPropertyPresentation(IDataProperty core)
        {
            if (core == null)
            {
                throw new ArgumentNullException(nameof(core));
            }

            Core = core;

            Setup();
        }
Esempio n. 27
0
        public static BestTemplate Parse(int id, IDataProperty property)
        {
            var t = new BestTemplate
            {
                ID          = id,
                Category    = Convert.ToInt32(property.Parent.Parent.Name),
                Gender      = property.Parent.Name == "male" ? 0 : 1,
                CommoditySN = property.Resolve <int>() ?? 0
            };

            return(t);
        }
        public static CategoryDiscountTemplate Parse(int id, IDataProperty property)
        {
            var t = new CategoryDiscountTemplate
            {
                ID           = id,
                Category     = Convert.ToByte(property.Parent.Name),
                CategorySub  = Convert.ToByte(property.Name),
                DiscountRate = property.Resolve <byte>() ?? 0
            };

            return(t);
        }
Esempio n. 29
0
        public FieldReactorTemplate(IDataProperty property)
        {
            ID = property.Resolve <int>("id") ?? -1;

            ReactorTime = property.Resolve <int>("reactorTime") ?? 0;

            F        = property.Resolve <bool>("f") ?? false;
            Position = new Point(
                property.Resolve <int>("x") ?? int.MinValue,
                property.Resolve <int>("y") ?? int.MinValue
                );
        }
Esempio n. 30
0
        public RewardEntryTemplate(int id, IDataProperty property)
        {
            ID = id;

            TemplateID  = property.Resolve <int>("item") ?? 0;
            MinQuantity = property.Resolve <int>("min") ?? 1;
            MaxQuantity = property.Resolve <int>("max") ?? 1;

            Money = property.Resolve <int>("money") ?? 0;

            Prob = property.Resolve <float>("prob") ?? 0.0f;
        }