public static void WritePropHeader(this EndianWriter stream, IMEPackage pcc, NameReference propName, PropertyType type, int size, int staticArrayIndex) { stream.WriteNameReference(propName, pcc); stream.WriteNameReference(type.ToString(), pcc); stream.WriteInt32(size); stream.WriteInt32(staticArrayIndex); }
public static void WriteEnumProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference enumName, NameReference enumValue, int staticArrayIndex) { stream.WritePropHeader(pcc, propName, PropertyType.ByteProperty, 8, staticArrayIndex); if (pcc.Game >= MEGame.ME3) { stream.WriteNameReference(enumName, pcc); } stream.WriteNameReference(enumValue, pcc); }
public static void WriteNameProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference value, int staticArrayIndex) { //Debug.WriteLine("Writing name property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6")); stream.WritePropHeader(pcc, propName, PropertyType.NameProperty, 8, staticArrayIndex); stream.WriteNameReference(value, pcc); }
public static void WriteStructProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference structName, Stream value, int staticArrayIndex) { //Debug.WriteLine("Writing struct property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6")); stream.WritePropHeader(pcc, propName, PropertyType.StructProperty, (int)value.Length, staticArrayIndex); stream.WriteNameReference(structName, pcc); stream.BaseStream.WriteStream(value); }
public static void WriteByteProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, byte value, int staticArrayIndex) { //Debug.WriteLine("Writing byte property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6")); stream.WritePropHeader(pcc, propName, PropertyType.ByteProperty, 1, staticArrayIndex); if (pcc.Game >= MEGame.ME3) { stream.WriteNameReference("None", pcc); } stream.WriteByte(value); }
public static void WriteDelegateProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, ScriptDelegate value, int staticArrayIndex) { stream.WritePropHeader(pcc, propName, PropertyType.DelegateProperty, 12, staticArrayIndex); stream.WriteInt32(value.Object); stream.WriteNameReference(value.FunctionName, pcc); }
public static void WriteNoneProperty(this EndianWriter stream, IMEPackage pcc) { //Debug.WriteLine("Writing none property at 0x" + stream.Position.ToString("X6")); stream.WriteNameReference("None", pcc); }