Exemple #1
0
    public override void Init()
    {
        Debug.LogError("===============");

        string path = ZTResource.Instance.LoadFromStreamingAssets("/db.bytes", "/DB/db.bytes");

        SqliteDataBase.OpenDatabase(path);

        DictProperty = new Dictionary <EProperty, DBProperty>();
        new ReadDBProperty().Load("SELECT * FROM Data_Property", DictProperty);

        DictQuality = new Dictionary <int, DBQuality>();
        new ReadDBQuality().Load("SELECT * FROM Data_Quality", DictQuality);

        DictHeroLevel = new Dictionary <int, DBHeroLevel>();
        new ReadDBHeroLevel().Load("SELECT * FROM Data_HeroLevel", DictHeroLevel);

        DictItem = new Dictionary <int, DBItem>();
        new ReadDBItem().Load("SELECT * FROM Data_Item", DictItem);

        DictEquip = new Dictionary <int, DBEquip>();
        new ReadDBEquip().Load("SELECT * FROM Data_Equip", DictEquip);

        DictEquipAdvance = new Dictionary <int, DBEquipAdvance>();
        new ReadDBEquipAdvance().Load("SELECT * FROM Data_EquipAdvance", DictEquipAdvance);

        DictEquipAdvanceCost = new Dictionary <int, Dictionary <int, DBEquipAdvanceCost> >();
        new ReadDBEquipAdvanceCost().Load("SELECT * FROM Data_EquipAdvanceCost", DictEquipAdvanceCost);

        DictEquipStreng = new Dictionary <int, DBEquipStreng>();
        new ReadDBEquipStreng().Load("SELECT * FROM Data_EquipStrengthen", DictEquipStreng);

        DictEquipStrengLevel = new Dictionary <int, Dictionary <int, DBEquipStrengLevel> >();
        new ReadDBEquipStrengLevel().Load("SELECT * FROM Data_EquipStrengthenLevel", DictEquipStrengLevel);

        DictEquipStar = new Dictionary <int, Dictionary <int, DBEquipStar> >();
        new ReadDBEquipStar().Load("SELECT * FROM Data_EquipStar", DictEquipStar);

        DictEquipSuit = new Dictionary <int, DBEquipSuit>();
        new ReadDBEquipSuit().Load("SELECT * FROM Data_EquipSuit", DictEquipSuit);

        DictGem = new Dictionary <int, DBGem>();
        new ReadDBGem().Load("SELECT * FROM Data_Gem", DictGem);

        DictGemLevel = new Dictionary <int, Dictionary <int, DBGemLevel> >();
        new ReadDBGemLevel().Load("SELECT * FROM Data_GemLevel", DictGemLevel);

        DictGemSuit = new Dictionary <int, DBGemSuit>();
        new ReadDBGemSuit().Load("SELECT * FROM Data_GemSuit", DictGemSuit);

        DictAward = new Dictionary <int, DBAward>();
        new ReadDBAward().Load("SELECT * FROM Data_Award", DictAward);

        DictWorld = new Dictionary <int, DBWorld>();
        new ReadDBWorld().Load("SELECT * FROM Data_World", DictWorld);

        DictCopy = new Dictionary <int, DBCopy>();
        new ReadDBCopy().Load("SELECT * FROM Data_Copy", DictCopy);

        DictScene = new Dictionary <int, DBScene>();
        new ReadDBScene().Load("SELECT * FROM Data_Scene", DictScene);

        DictEffect = new Dictionary <int, DBEffect>();
        new ReadDBEffect().Load("SELECT * FROM Data_Effect", DictEffect);

        DictBuff = new Dictionary <int, DBBuff>();
        new ReadDBBuff().Load("SELECT * FROM Data_Buff", DictBuff);

        DictBuffAttr = new Dictionary <int, DBBuffAttr>();
        new ReadDBBuffAttr().Load("SELECT * FROM Data_BuffAttr", DictBuffAttr);

        DictRelics = new Dictionary <int, DBRelics>();
        new ReadDBRelics().Load("SELECT * FROM Data_Relics", DictRelics);

        DictRace = new Dictionary <int, DBRace>();
        new ReadDBRace().Load("SELECT * FROM Data_Race", DictRace);

        DictActorGroup = new Dictionary <int, DBActorGroup>();
        new ReadDBActorGroup().Load("SELECT * FROM Data_ActorGroup", DictActorGroup);

        DictStore = new Dictionary <int, Dictionary <int, DBStore> >();
        new ReadDBStore().Load("SELECT * FROM Data_Store", DictStore);

        DictStoreType = new Dictionary <int, DBStoreType>();
        new ReadDBStoreType().Load("SELECT * FROM Data_StoreType", DictStoreType);


        DictPetLevel = new Dictionary <int, Dictionary <int, DBPetLevel> >();
        new ReadDBPetLevel().Load("SELECT * FROM Data_PetLevel", DictPetLevel);

        DictPartnerBase = new Dictionary <int, DBPartner>();
        new ReadDBPartner().Load("SELECT * FROM Data_Partner", DictPartnerBase);

        DictPartnerLevel = new Dictionary <int, DBPartnerLevel>();
        new ReadDBPartnerLevel().Load("SELECT * FROM Data_PartnerLevel", DictPartnerLevel);

        DictPartnerAdvance = new Dictionary <int, DBPartnerAdvance>();
        new ReadDBPartnerAdvance().Load("SELECT * FROM Data_PartnerAdvance", DictPartnerAdvance);

        DictPartnerWash = new Dictionary <int, DBPartnerWash>();
        new ReadDBPartnerWash().Load("SELECT * FROM Data_PartnerWash", DictPartnerWash);

        DictPartnerWake = new Dictionary <int, DBPartnerWake>();
        new ReadDBPartnerWake().Load("SELECT * FROM Data_PartnerWake", DictPartnerWake);

        DictPartnerFetter = new Dictionary <int, DBPartnerFetter>();
        new ReadDBPartnerFetter().Load("SELECT * FROM Data_PartnerFetter", DictPartnerFetter);

        DictPartnerStar = new Dictionary <int, DBPartnerStar>();
        new ReadDBPartnerStar().Load("SELECT * FROM Data_PartnerStar ", DictPartnerStar);

        DictTask = new Dictionary <int, DBTask>();
        new ReadDBTask().Load("SELECT * FROM Data_Task", DictTask);

        DictCamera = new Dictionary <int, DBCamera>();
        new ReadDBCamera().Load("SELECT * FROM Data_Camera", DictCamera);

        DictEntiny = new Dictionary <int, DBEntiny>();
        new ReadDBEntiny().Load("SELECT * FROM Data_Entiny", DictEntiny);

        DictAdventure = new Dictionary <int, DBAdventure>();
        new ReadDBAdventure().Load("SELECT * FROM Data_Adventure", DictAdventure);

        DictSkill = new Dictionary <int, DBSkill>();
        new ReadDBSkill().Load("SELECT * FROM Data_Skill", DictSkill);

        DictSkillTalent = new Dictionary <int, DBSkillTalent>();
        new ReadDBSkillTalent().Load("SELECT * FROM Data_SkillTalent", DictSkillTalent);

        DictMine = new Dictionary <int, DBMine>();
        new ReadDBMine().Load("SELECT * FROM Data_Mine", DictMine);

        Dictionary <int, DBEntiny> .Enumerator em1 = DictEntiny.GetEnumerator();
        while (em1.MoveNext())
        {
            switch (em1.Current.Value.Type)
            {
            case EActorType.PET:
                DictPet[em1.Current.Key] = em1.Current.Value;
                break;

            case EActorType.PARTNER:
                DictPartner[em1.Current.Key] = em1.Current.Value;
                break;

            case EActorType.PLAYER:
                DictRole[em1.Current.Key] = em1.Current.Value;
                break;

            case EActorType.MOUNT:
                DictMount[em1.Current.Key] = em1.Current.Value;
                break;

            case EActorType.NPC:
                DictNPC[em1.Current.Key] = em1.Current.Value;
                break;

            case EActorType.MACHINE:
                DictMachine[em1.Current.Key] = em1.Current.Value;
                break;
            }
        }
        em1.Dispose();

        Dictionary <int, DBItem> .Enumerator em2 = DictItem.GetEnumerator();
        while (em2.MoveNext())
        {
            switch (em2.Current.Value.ItemType)
            {
            case EItemType.ACTION:
                DictAction[em2.Current.Key] = em2.Current.Value;
                break;

            case EItemType.MONEY:
                DictMoney[em2.Current.Key] = em2.Current.Value;
                break;
            }
        }
        em2.Dispose();
    }