コード例 #1
0
 public DungeonRestrictions()
 {
     Items  = new DungeonItemRestrictions();
     Pets   = new DungeonPetRestrictions();
     Skills = new DungeonSkillRestrictions();
     Spells = new DungeonSpellRestrictions();
 }
コード例 #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.GetVersion();

            switch (version)
            {
            case 0:
            {
                reader.ReadBlock(r => Items  = r.ReadTypeCreate <DungeonItemRestrictions>(r));
                reader.ReadBlock(r => Pets   = r.ReadTypeCreate <DungeonPetRestrictions>(r));
                reader.ReadBlock(r => Skills = r.ReadTypeCreate <DungeonSkillRestrictions>(r));
                reader.ReadBlock(r => Spells = r.ReadTypeCreate <DungeonSpellRestrictions>(r));
            }
            break;
            }

            if (Items == null)
            {
                Items = new DungeonItemRestrictions();
            }

            if (Pets == null)
            {
                Pets = new DungeonPetRestrictions();
            }

            if (Skills == null)
            {
                Skills = new DungeonSkillRestrictions();
            }

            if (Spells == null)
            {
                Spells = new DungeonSpellRestrictions();
            }
        }