public static void WriteStringProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, string value, int staticArrayIndex) { //Debug.WriteLine("Writing string property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6")); int strLen = value.Length == 0 ? 0 : value.Length + 1; if (pcc.Game == MEGame.ME3) { stream.WritePropHeader(pcc, propName, PropertyType.StrProperty, (strLen * 2) + 4, staticArrayIndex); stream.WriteUnrealStringUnicode(value); } else { stream.WritePropHeader(pcc, propName, PropertyType.StrProperty, strLen + 4, staticArrayIndex); stream.WriteUnrealStringASCII(value); } }
public static void WriteStringRefProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, int value, int staticArrayIndex) { //Debug.WriteLine("Writing stringref property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6")); stream.WritePropHeader(pcc, propName, PropertyType.StringRefProperty, 4, staticArrayIndex); stream.WriteInt32(value); }
public static void WriteArrayProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, int count, Stream value, int staticArrayIndex) { //Debug.WriteLine("Writing array property " + propName + ", count: " + count + " at 0x" + stream.Position.ToString("X6")+", length: "+value.Length); stream.WritePropHeader(pcc, propName, PropertyType.ArrayProperty, 4 + (int)value.Length, staticArrayIndex); stream.WriteInt32(count); stream.BaseStream.WriteStream(value); }
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 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 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); }