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(); } } }
public override TesField ReadField(TesFileReader fr) { TesField result = base.ReadField(fr); if (result == null) { string id = fr.GetTypeID(); switch (id) { case "HEDR": HEDR = new TES4_HEDR(fr.GetField()); result = HEDR; break; } } return(result); }
public virtual TesField ReadField(TesFileReader fr) { TesField result = null; string id = fr.GetTypeID(); switch (id) { //ワールドデータ内にある"OFST"で、1箇所DataSizeが0になっており、以降のデータが書き出されている場所がある case "OFST": if (fr.GetInt16(4, false) == 0) { result = new TesField(fr, false); result.Values.Add(new TesBytes(fr.GetBytes(fr.Length - fr.Position))); } break; } return(result); }
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; } } }