Beispiel #1
0
 public TesTableStrings(string path)
 {
     fr       = new TesFileReader(path);
     count    = fr.GetUInt32();
     dataSize = fr.GetUInt32();
     for (int i = 0; i < count; i++)
     {
         de.Add(fr.GetUInt32(), fr.GetUInt32());
     }
     pos = fr.Position;
 }
Beispiel #2
0
        public TesGroup(TesFileReader fr, bool readRecord = true)
        {
            GRUP     = new TesString(fr);
            DataSize = new TesUInt32(fr);
            OutputItems.Add(GRUP);
            OutputItems.Add(DataSize);

            //グループタイプ別
            uint type = fr.GetUInt32(4, false);

            switch (type)
            {
            case 0:
                Signature = new TesString(fr);
                OutputItems.Add(Signature);
                break;

            case 1:
            case 6:
            case 8:
            case 9:
                FormID = new TesUInt32(fr);
                OutputItems.Add(FormID);
                break;

            case 2:
            case 3:
                Index = new TesUInt32(fr);
                OutputItems.Add(Index);
                break;

            case 4:
            case 5:
                Grid = new TesCellGrid(fr);
                OutputItems.Add(Grid);
                break;

            default:
                throw new Exception();
            }
            GroupType = new TesUInt32(fr);
            Other     = new TesBytes(fr.GetBytes(8));
            OutputItems.Add(GroupType);
            OutputItems.Add(Other);

            if (readRecord)
            {
                while (!fr.EOF)
                {
                    Records.Add(new TesRecord(fr.GetRecord()));
                }
            }
            OutputItems.Add(Records);
        }
Beispiel #3
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;
                }
            }
        }
Beispiel #4
0
 public TesUInt32(TesFileReader fr)
 {
     this.Value = fr.GetUInt32();
 }