public static CRDTRecord From(Byte[] bytes) { return(new CRDTRecord() { criticalDamage = BitConverter.ToUInt16(bytes, 0), unknown = BitConverter.ToUInt16(bytes, 2), criticalPercentMult = BitConverter.ToUInt16(bytes, 4), flags = (Flags)BitConverter.ToUInt32(bytes, 8), unknown2 = BitConverter.ToUInt32(bytes, 12), criticalSpellEffect = FormID.From(bytes, 16), unknown3 = BitConverter.ToUInt32(bytes, 20), }); }
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; }) }); }