コード例 #1
0
            protected override void Process()
            {
                string npc_filename  = Paths.GetNPCData();
                string item_filename = Paths.GetItemData();
                string ai_filename   = Paths.GetAIData();
                string geo_filename  = Paths.GetNpcPositionData();

                //
                LoadedNPC  = false;
                LoadedItem = false;
                LoadedAI   = false;
                LoadedGeo  = false;
                LoadedAll  = false;
                LoadedAny  = false;
                //
                if (cancelPending)
                {
                    return;
                }
                if (File.Exists(npc_filename))
                {
                    setStatus("Loading NPC Data...", false);
                    NpcMgr.Load(npc_filename, npc_Progress);
                    LoadedNPC = true;
                    LoadedAny = true;
                }
                //
                if (cancelPending)
                {
                    return;
                }
                if (File.Exists(item_filename))
                {
                    setStatus("Loading Item Data...", false);
                    ItemMgr.Load(item_filename, item_Progress);
                    LoadedItem = true;
                    LoadedAny  = true;
                }
                //
                if (cancelPending)
                {
                    return;
                }
                if (File.Exists(ai_filename))
                {
                    setStatus("Loading AI Scripts...", false);
                    ScriptParser parser = new ScriptParser();
                    parser.OnProgress += ai_Progress;
                    parser.Load(ai_filename);
                    ScriptMgr.Header = parser.Header;
                    ScriptMgr.Items  = parser.Items;
                    LoadedAI         = true;
                    LoadedAny        = true;
                }
                //
                if (cancelPending)
                {
                    return;
                }
                if (File.Exists(geo_filename))
                {
                    setStatus("Loading NPC Position Data...", false);
                    GeoMgr.Load(geo_filename, geo_Progress);
                    LoadedGeo = true;
                    LoadedAny = true;
                }
                //
                LoadedAll = (LoadedNPC && LoadedItem && LoadedAI && LoadedGeo);
            }
コード例 #2
0
        //=========================

        protected override void Process()
        {
            parser.Load(filename);
        }