Beispiel #1
0
        public static void SerialiseBuggyList <T>(this MfcSerialiser archive, List <T> list, ushort hack) where T : MfcObject
        {
            if (list.Count > ushort.MaxValue)
            {
                throw new NotImplementedException("List length > 0xffff not supported");
            }

            archive.SerialiseUInt16((ushort)list.Count);

            bool first = true;

            foreach (var item in list)
            {
                if (first)
                {
                    archive.SerialiseObject(item);
                    first = false;
                }
                else
                {
                    archive.SerialiseUInt16((ushort)(archive.GetSerialisedClassIndexHack(item) + hack));
                    archive.SerialiseObjectNoHeader(item);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Serialise an MFC-format ASCII CString
 /// </summary>
 public static void SerialiseString(this MfcSerialiser archive, string value)
 {
     WriteStringLength(archive.Stream, value);
     archive.Stream.WriteAsciiString(value);
 }
Beispiel #3
0
 public static void SerialiseBytes(this MfcSerialiser archive, byte[] value)
 {
     archive.Stream.Write(value);
 }
Beispiel #4
0
 public static void SerialiseByte(this MfcSerialiser archive, byte value)
 {
     archive.Stream.Write((byte)value);
 }
Beispiel #5
0
 public static void SerialiseUInt16(this MfcSerialiser archive, ushort value)
 {
     archive.Stream.Write((ushort)value);
 }
Beispiel #6
0
 public static void SerialiseUInt32(this MfcSerialiser archive, uint value)
 {
     archive.Stream.Write((uint)value);
 }