Esempio n. 1
0
        private void SaveObjectList(string archive, string path)
        {
            string[] content = path.Split('/');

            string dir   = content[0];
            string layer = content[1];
            string file  = content[2];

            BCSV bcsv = new BCSV(mMapFiles[archive].OpenFile($"/stage/jmp/{path}"));

            bcsv.mEntries.Clear();

            List <AbstractObj> objs = mObjects[archive][layer];

            foreach (AbstractObj o in objs)
            {
                if (o.mFile == file)
                {
                    o.Save();
                    bcsv.mEntries.Add(o.mEntry);
                }
            }

            bcsv.Save();
            bcsv.Close();
        }
Esempio n. 2
0
        public Galaxy(Game game, string name)
        {
            mGame       = game;
            mFilesystem = game.mFilesystem;
            mName       = name;

            mZones = new Dictionary <string, Zone>();
            RARCFilesystem scenarioFile = new RARCFilesystem(mFilesystem.OpenFile($"/StageData/{name}/{name}Scenario.arc"));
            BCSV           scenarioBCSV = new BCSV(scenarioFile.OpenFile("/root/ScenarioData.bcsv"));

            mScenarioEntries = scenarioBCSV.mEntries;
            scenarioBCSV.Close();

            BCSV zonesBCSV = new BCSV(scenarioFile.OpenFile("/root/ZoneList.bcsv"));

            foreach (BCSV.Entry e in zonesBCSV.mEntries)
            {
                string n = e.Get <string>("ZoneName");
                mZones.Add(n, new Zone(this, n));
            }

            zonesBCSV.Close();
            scenarioFile.Close();

            if (!NameHolder.HasGalaxyName(name))
            {
                return;
            }

            mGalaxyName = NameHolder.GetGalaxyName(name);
        }
Esempio n. 3
0
        public void AssignsObjectsToList(string archive, string path)
        {
            string[] data  = path.Split('/');
            string   layer = data[1];
            string   dir   = data[2];

            if (!mObjects.ContainsKey(archive))
            {
                mObjects.Add(archive, new Dictionary <string, List <AbstractObj> >());
            }

            if (!mObjects[archive].ContainsKey(layer))
            {
                mObjects[archive].Add(layer, new List <AbstractObj>());
            }

            if (!mZones.ContainsKey(layer))
            {
                mZones.Add(layer, new List <StageObj>());
            }

            BCSV bcsv = new BCSV(mMapFiles[archive].OpenFile($"/stage/jmp/{path}"));

            foreach (BCSV.Entry e in bcsv.mEntries)
            {
                switch (dir)
                {
                case "AreaObjInfo":
                    mObjects[archive][layer].Add(new AreaObj(e, this, path));
                    break;

                case "CameraCubeInfo":
                    mObjects[archive][layer].Add(new CameraObj(e, this, path));
                    break;

                case "StageObjInfo":
                    mZones[layer].Add(new StageObj(e));
                    break;

                case "ObjInfo":
                    mObjects[archive][layer].Add(new LevelObj(e, this, path));
                    break;

                case "DemoObjInfo":
                    mObjects[archive][layer].Add(new DemoObj(e, this, path));
                    break;

                case "GeneralPosInfo":
                    mObjects[archive][layer].Add(new GeneralPosObj(e, this, path));
                    break;

                case "DebugMoveInfo":
                    mObjects[archive][layer].Add(new DebugMoveObj(e, this, path));
                    break;

                case "PlanetObjInfo":
                    mObjects[archive][layer].Add(new PlanetObj(e, this, path));
                    break;

                case "StartInfo":
                    mObjects[archive][layer].Add(new StartObj(e, this, path));
                    break;

                case "MapPartsInfo":
                    mObjects[archive][layer].Add(new MapPartsObj(e, this, path));
                    break;
                }
            }

            bcsv.Close();
        }