/// <summary> /// The serialise. /// </summary> /// <param name="serialise"> /// The serialise. /// </param> /// <exception cref="Exception"> /// </exception> public override void Serialise(IwSerialise serialise) { base.Serialise(serialise); uint resCount = 0; serialise.UInt32(ref resCount); bool unknown0 = false; serialise.Bool(ref unknown0); bool unknown1 = true; serialise.Bool(ref unknown1); while (resCount > 0) { var pos = serialise.Position; uint length = 0; serialise.UInt32(ref length); CIwManaged res = null; serialise.ManagedObject(this.Hash, ref res); this.resources.Add((CIwResource)res, false); --resCount; if (serialise.Position != pos + length) { throw new Exception( string.Format( "Parse of {0} failed: wrong position by {1} bytes", res.GetType().Name, serialise.Position - (pos + length))); serialise.Position = pos + length; } } }
/// <summary> /// The serialise. /// </summary> /// <param name="serialise"> /// The serialise. /// </param> public void Serialise(IwSerialise serialise) { this.array.SerialiseHeader(serialise); for (uint i = 0; i < this.array.Size; ++i) { CIwManaged m = this.array[(int)i]; serialise.ManagedObject(ref m); this.array[(int)i] = m; } }