コード例 #1
0
 public TesRecordWorldspaceMain(TesFileReader fr) : base(fr, false)
 {
     while (!fr.EOF)
     {
         string id = fr.GetTypeID();
         if (id.Equals("CELL"))
         {
             Cell = new TesRecordCell(fr.GetCell());
             OutputItems.Add(Cell);
         }
         else if (id.Equals("GRUP"))
         {
             if (Blocks == null)
             {
                 Blocks = new TesList <TesCellBlock>();
                 OutputItems.Add(Blocks);
             }
             Blocks.Add(new TesCellBlock(fr.GetGroup()));
         }
         else
         {
             throw new Exception();
         }
     }
 }
コード例 #2
0
 public TesRecordWorldspace(TesFileReader fr)
 {
     WRLD = new TesRecord(fr.GetRecord());
     Main = new TesRecordWorldspaceMain(fr.GetGroup());
     OutputItems.Add(WRLD);
     OutputItems.Add(Main);
 }
コード例 #3
0
 public TesCellMain(TesFileReader fr) : base(fr, false)
 {
     while (!fr.EOF)
     {
         Subs.Add(new TesCellMainSub(fr.GetGroup()));
     }
     OutputItems.Add(Subs);
 }
コード例 #4
0
 public TesCellBlock(TesFileReader fr) : base(fr, false)
 {
     while (!fr.EOF)
     {
         SubBlocks.Add(new TesCellSubBlock(fr.GetGroup()));
     }
     OutputItems.Add(SubBlocks);
 }
コード例 #5
0
        public TesRecordCell(TesFileReader fr) : base(fr, false)
        {
            CellInfo = new TesBytes(fr.GetBytes(Header.DataSize));
            OutputItems.Add(CellInfo);

            if (!fr.EOF)
            {
                CellMain = new TesCellMain(fr.GetGroup());
                OutputItems.Add(CellMain);
            }
        }
コード例 #6
0
        public TesFile(string path, List <string> idList = null)
        {
            TesFileReader fr = new TesFileReader(path);

            TES4 = new TesTES4(fr.GetRecord());
            OutputItems.Add(TES4);

            string id = null;

            while (!fr.EOF)
            {
                id = fr.GetTypeID(8);

                if (idList != null && !idList.Contains(id))
                {
                    fr.Seek(fr.GetUInt32(4, false));
                    continue;
                }

                switch (id)
                {
                case "NPC_":
                    TesNPC npc_ = new TesNPC(fr.GetGroup());
                    OutputItems.Add(npc_);
                    Groups.Add(id, npc_);
                    break;

                case "CELL":
                    TesCell cell = new TesCell(fr.GetGroup());
                    OutputItems.Add(cell);
                    Groups.Add(id, cell);
                    break;

                case "WRLD":
                    TesWorldspace wrld = new TesWorldspace(fr.GetGroup());
                    OutputItems.Add(wrld);
                    Groups.Add(id, wrld);
                    break;

                case "DIAL":
                    OutputItems.Add(new TesBytes(fr.GetBytes(fr.GetUInt32(4, false))));
                    break;

                case "HAZD":
                    string id2 = fr.GetTypeID(24);
                    if (id2.Equals("HAZD"))
                    {
                        OutputItems.Add(new TesBytes(fr.GetBytes(fr.GetUInt32(4, false))));
                    }
                    else if (id2.Equals("GRUP"))
                    {
                        OutputItems.Add(new TesBytes(fr.GetBytes(fr.GetUInt32(4, false))));
                    }
                    break;

                default:
                    TesGroup grup = new TesGroup(fr.GetGroup());
                    OutputItems.Add(grup);
                    Groups.Add(id, grup);
                    break;
                }
            }
        }