public static TES4Record From(SSEPlugin.Record record) { return(new TES4Record() { flags = (Flags)record.flags, cnam = record.GetFirstField("CNAM", ZString.From), snam = record.GetFirstField("SNAM", ZString.From), hedr = record.GetFirstField("HEDR", HEDRRecord.From), mast = record.GetAllFields("MAST", ZString.From), onam = record.GetFirstField("ONAM", bytes => { var formIds = new List <FormID>(); for (int i = 0; i < bytes.Length; i += 4) { formIds.Add(FormID.From(bytes, i)); } return formIds; }) }); }
public static WEAPRecord From(SSEPlugin.Record record, TES4Record plugin) { return(new WEAPRecord() { bamt = record.GetFirstField("BAMT", FormID.From), bids = record.GetFirstField("BIDS", FormID.From), cnam = record.GetFirstField("CNAM", FormID.From), crtd = record.GetFirstField("CRTD", CRDTRecord.From), data = record.GetFirstField("DATA", DATARecord.From), desc = record.GetFirstField("DESC", b => LString.From(b, plugin)), eamt = record.GetFirstField("EAMT", b => BitConverter.ToUInt16(b, 0)), edid = record.GetFirstField("EDID", ZString.From), eitm = record.GetFirstField("EITM", FormID.From), etyp = record.GetFirstField("ETYP", FormID.From), full = record.GetFirstField("FULL", b => LString.From(b, plugin)), dnam = record.GetFirstField("DNAM", DNAMRecord.From) }); }