public TesCellGrid(TesFileReader fr) : base() { Y = new TesInt16(fr); X = new TesInt16(fr); OutputItems.Add(Y); OutputItems.Add(X); }
public TesNPC(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { Records.Add(new TesRecordNPC(fr.GetRecord())); } }
public Tes3DPos(TesFileReader fr) { X = new TesFloat(fr); Y = new TesFloat(fr); Z = new TesFloat(fr); Initialize(); }
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 TesRecordWorldspace(TesFileReader fr) { WRLD = new TesRecord(fr.GetRecord()); Main = new TesRecordWorldspaceMain(fr.GetGroup()); OutputItems.Add(WRLD); OutputItems.Add(Main); }
public TesCellMainSub(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { AddRecord(new TesRecord(fr.GetRecord())); } }
public TesCellSubBlock(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { Cells.Add(new TesRecordCell(fr.GetCell())); } OutputItems.Add(Cells); }
public TesCellMain(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { Subs.Add(new TesCellMainSub(fr.GetGroup())); } OutputItems.Add(Subs); }
public TesCellBlock(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { SubBlocks.Add(new TesCellSubBlock(fr.GetGroup())); } OutputItems.Add(SubBlocks); }
public TesWorldspace(TesFileReader fr) : base(fr, false) { while (!fr.EOF) { Records.Add(new TesRecordWorldspace(fr.GetCell())); } OutputItems.Add(Records); }
public TES4_HEDR(TesFileReader fr) : base(fr, false) { Version = new TesFloat(fr); NumberOfRecords = new TesUInt32(fr); NextObjectID = new TesUInt32(fr); Values.Add(Version); Values.Add(NumberOfRecords); Values.Add(NextObjectID); }
public TesFileReader GetCopyReader(uint count, bool next = true) { TesFileReader result = new TesFileReader(br, pos, pos + count); if (next) { pos += count; } return(result); }
public TesHeader(TesFileReader fr) { Signature = new TesString(fr); DataSize = new TesUInt32(fr); RecordFlags = new TesUInt32(fr); FormID = new TesUInt32(fr); VersionControlInfo1 = new TesUInt32(fr); FormVersion = new TesUInt16(fr); VersionControlInfo2 = new TesUInt16(fr); Initialize(); }
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); } }
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; }
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 TesFileReader GetRecord(bool next = true) { long count = GetUInt32(4, false) + 24; TesFileReader result = new TesFileReader(br, pos, pos + count); if (next) { pos += count; } return(result); }
public TesFileReader GetField(bool next = true) { long count = GetUInt16(4, false) + 6; TesFileReader result = new TesFileReader(br, pos, pos + count); if (next) { pos += count; } return(result); }
public TesField(TesFileReader fr, bool readValue = true) { Signature = new TesString(fr.GetString(4)); DataSize = new TesUInt16(fr); OutputItems.Add(Signature); OutputItems.Add(DataSize); if (readValue) { Values.Add(fr.GetBytes(DataSize.Value)); } OutputItems.Add(Values); }
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 TesRecord(TesFileReader fr, bool readFiled = true) { Header = new TesHeader(fr); OutputItems.Add(Header); if (readFiled) { if (Header.Signature == "NAVM" || Header.Signature == "LAND") { OutputItems.Add(new TesBytes(fr.GetBytes(Header.DataSize))); } else { while (!fr.EOF) { TesField field = ReadField(fr) ?? new TesField(fr.GetField()); AddField(field); } } } }
/// <summary> /// Cellは CELL レコードと、その直後のGRUPを範囲とする /// </summary> /// <param name="next"></param> /// <returns></returns> public TesFileReader GetCell(bool next = true) { //CELLレコードのサイズ long count = GetUInt32(4, false) + 24; //読込みサイズがファイルサイズと一致する場合、GRUPなし if (pos + count < len && GetTypeID(count).Equals("GRUP")) { //CELLレコード後のGROUPのサイズを加算 count += GetUInt32(count + 4, false); } TesFileReader result = new TesFileReader(br, pos, pos + count); if (next) { pos += count; } 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; } } }
public TesRotation(TesFileReader fr) { X = fr.GetBytes(4); Y = fr.GetBytes(4); Z = fr.GetBytes(4); }
public TesRecordNPC(TesFileReader fr) : base(fr, false) { OutputItems.Add(fr.GetBytes(Header.DataSize)); }
public TesUInt16(TesFileReader fr) { this.Value = fr.GetUInt16(); }
public TesFloat(TesFileReader fr) { this.Value = fr.GetFloat(); }
public TesTES4(TesFileReader fr) : base(fr) { }
public TesString(TesFileReader fr) { this.Value = fr.GetString(4); this.isNullTerminated = false; }