public TesCellMainSub(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { AddRecord(new TesRecord(fr.GetRecord())); } }
public TesNPC(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { Records.Add(new TesRecordNPC(fr.GetRecord())); } }
public TesRecordWorldspace(TesFileReader fr) { WRLD = new TesRecord(fr.GetRecord()); Main = new TesRecordWorldspaceMain(fr.GetGroup()); OutputItems.Add(WRLD); OutputItems.Add(Main); }
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); }
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; } } }