public Record(string type, string editor_id, UInt32 flags) { this.type = type.ToCharArray(0, 4); this.flags = flags; this.id = FormID.set(editor_id); this.revision = 5906; this.version = 43; this.unknown = 0; }
private void make_hedr(int num_records) { MemoryStream mstream = new MemoryStream(); BinaryWriter b_writer = new BinaryWriter(mstream); b_writer.Write(1.7f); b_writer.Write(num_records); b_writer.Write(FormID.getHEDRObj()); HEDR = new Field("HEDR", mstream.ToArray()); }
public void add_masters(params string[] files) { //Log.confirm("WARNING: Adding master file to TES4: Record. It is your responsibility to adjust form_ids with the mod_index"); MAST_ = new List <Field>(); DATA_ = new List <Field>(); foreach (string file in files) { FormID.add_master_file(); MAST_.Add(new Field("MAST", Text.zstring(file))); DATA_.Add(new Field("DATA", new byte[8])); } }
public Record(string type, bool compressed = false) { if (type == null) { return; } this.type = type.ToCharArray(0, 4); //this.flags = flags; if (compressed) { this.compressed = compressed; this.flags = BinaryFlag.set((uint)0, (uint)FLAGS.compressed); } this.id = FormID.getNew(); this.revision = 5906; this.version = 43; this.unknown = 0; }
public void clone(Record r, string editor_id) { this.compressed = r.isCompressed(); this.type = r.type; this.dataSize = r.dataSize; this.flags = r.flags; Field EDID = r.find_field_OR_FAIL("EDID", "To Be Cloned Record has no Editor_ID, is it a REFR?"); EDID.replaceData(Text.editor_id(editor_id)); this.id = FormID.set(editor_id); this.revision = r.revision; this.version = r.version; this.unknown = r.unknown; this.fields = new List <Field>();// r.fields; foreach (Field f in r.fields) { this.fields.Add(new Field(f)); } }
// Call to assign new formid. LGTM calls this public void reset_formid(string editor_id) { this.id = FormID.set(editor_id); }