public void Serialize(IFileStream stream) { stream.SerializeValue(ref this.X); stream.SerializeValue(ref this.Y); stream.SerializeValue(ref this.Z); stream.SerializeValue(ref this.W); }
public object Deserialize(IFileStream stream) { var transform = new Game.EngineTransform(); stream.SerializeValue(ref transform.Flags); if ((transform.Flags & 1) == 1) { stream.SerializeValue(ref transform.Unknown1); stream.SerializeValue(ref transform.Unknown2); stream.SerializeValue(ref transform.Unknown3); } if ((transform.Flags & 2) == 2) { stream.SerializeValue(ref transform.Unknown4); stream.SerializeValue(ref transform.Unknown5); stream.SerializeValue(ref transform.Unknown6); } if ((transform.Flags & 4) == 4) { stream.SerializeValue(ref transform.Unknown7); stream.SerializeValue(ref transform.Unknown8); stream.SerializeValue(ref transform.Unknown9); } return(transform); }
public object Deserialize(IFileStream stream) { var transform = new Game.EngineTransform(); stream.SerializeValue(ref transform.Flags); if ((transform.Flags & 1) == 1) { stream.SerializeValue(ref transform.Unknown1); stream.SerializeValue(ref transform.Unknown2); stream.SerializeValue(ref transform.Unknown3); } if ((transform.Flags & 2) == 2) { stream.SerializeValue(ref transform.Unknown4); stream.SerializeValue(ref transform.Unknown5); stream.SerializeValue(ref transform.Unknown6); } if ((transform.Flags & 4) == 4) { stream.SerializeValue(ref transform.Unknown7); stream.SerializeValue(ref transform.Unknown8); stream.SerializeValue(ref transform.Unknown9); } return transform; }
public void Serialize(IFileStream stream) { stream.SerializeValue(ref this.X); stream.SerializeValue(ref this.Y); stream.SerializeValue(ref this.Z); stream.SerializeValue(ref this.W); }
public object Deserialize(IFileStream stream) { uint count = 0; stream.SerializeValue(ref count); string elementTypeName = null; stream.SerializeName(ref elementTypeName); short unk2 = -1; stream.SerializeValue(ref unk2); if (unk2 != -1) { throw new InvalidOperationException(); } var list = new List <object>(); for (uint i = 0; i < count; i++) { var element = _Serializer.Deserialize(stream); list.Add(element); } return(list); }
public object Deserialize(IFileStream stream) { var value = new Game.IdTag(); stream.SerializeValue(ref value.Unknown0); stream.SerializeValue(ref value.Unknown1); return(value); }
public static void Serialize(object target, IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { while (true) { string name = null; stream.SerializeName(ref name); if (String.IsNullOrEmpty(name) == true || name == "None") { break; } string type = null; stream.SerializeName(ref type); short unk2 = -1; stream.SerializeValue(ref unk2); if (unk2 != -1) { throw new FormatException(); } var start = stream.Position; uint size = 0; stream.SerializeValue(ref size); if (size < 4) { throw new FormatException(); } var end = start + size; if (target is GenericObject) { ReadGenericObjectProperty((GenericObject) target, stream, type, size, name); } else { ReadPropertyValue(stream, target, type, name); } if (stream.Position != end) { throw new FormatException(); } } } else { throw new NotSupportedException(); } }
public static void Serialize(object target, IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { while (true) { string name = null; stream.SerializeName(ref name); if (String.IsNullOrEmpty(name) == true || name == "None") { break; } string type = null; stream.SerializeName(ref type); short unk2 = -1; stream.SerializeValue(ref unk2); if (unk2 != -1) { throw new FormatException(); } var start = stream.Position; uint size = 0; stream.SerializeValue(ref size); if (size < 4) { throw new FormatException(); } var end = start + size; if (target is GenericObject) { ReadGenericObjectProperty((GenericObject)target, stream, type, size, name); } else { ReadPropertyValue(stream, target, type, name); } if (stream.Position != end) { throw new FormatException(); } } } else { throw new NotSupportedException(); } }
public object Deserialize(IFileStream stream) { float value = 0.0f; stream.SerializeValue(ref value); return(value); }
public object Deserialize(IFileStream stream) { bool value = false; stream.SerializeValue(ref value); return(value); }
public object Deserialize(IFileStream stream) { Guid value = Guid.Empty; stream.SerializeValue(ref value); return(value); }
public object Deserialize(IFileStream stream) { uint value = 0; stream.SerializeValue(ref value); return(value); }
public object Deserialize(IFileStream stream) { string value = null; stream.SerializeValue(ref value); return(value); }
public override void Serialize(IFileStream stream) { base.Serialize(stream); stream.SerializeValue(ref this._Unknown0); if (this.Unknown0 != 0) { throw new FormatException(); } if (stream.Mode == SerializeMode.Reading) { this.Mipmaps.Clear(); uint mipmapCount = 0; stream.SerializeValue(ref mipmapCount); for (uint i = 0; i < mipmapCount; i++) { var mip = new Mipmap(); stream.SerializeValue(ref mip.Width); stream.SerializeValue(ref mip.Height); stream.SerializeValue(ref mip.Unknown2); uint size = 0; stream.SerializeValue(ref size); stream.SerializeValue(ref mip.Data, size); this.Mipmaps.Add(mip); } } else { throw new NotSupportedException(); } uint unknown1 = 0; stream.SerializeValue(ref unknown1); if (unknown1 != 0) { throw new FormatException(); } byte unknown2 = 0; stream.SerializeValue(ref unknown2); if (unknown2 != 0) { throw new FormatException(); } }
public void Serialize(IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { stream.SerializeValue(ref this.Data, (int)stream.Length); } else { throw new NotSupportedException(); } }
public void Serialize(IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { stream.SerializeValue(ref this.Data, (int)stream.Length); } else { throw new NotSupportedException(); } }
public virtual void Serialize(IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { PropertySerializer.Serialize(this, stream); stream.SerializeValue(ref _objectUnknown); } else { throw new NotSupportedException(); } }
public object Deserialize(IFileStream stream) { string typeName = null; stream.SerializeName(ref typeName); uint valueSize = 0; stream.SerializeValue(ref valueSize); var serializer = PropertySerializer.GetSerializer(typeName); if (serializer != null) { var value = serializer.Deserialize(stream); return value; } stream.Position += valueSize - 4; return null; }
private static void ReadGenericObjectProperty(GenericObject target, IFileStream stream, string type, uint size, string name) { IPropertySerializer serializer = GetSerializer(type); if (serializer != null) { target.SetProperty(name, type, serializer.Deserialize(stream)); } else { uint valueSize = size - 4; byte[] value = new byte[valueSize]; stream.SerializeValue(ref value, valueSize); target.SetProperty(name, type, value); } }
public object Deserialize(IFileStream stream) { string typeName = null; stream.SerializeName(ref typeName); uint valueSize = 0; stream.SerializeValue(ref valueSize); var serializer = PropertySerializer.GetSerializer(typeName); if (serializer != null) { var value = serializer.Deserialize(stream); return(value); } stream.Position += valueSize - 4; return(null); }
public override void Serialize(IFileStream stream) { base.Serialize(stream); stream.SerializeValue(ref this._Unknown0); if (this.Unknown0 != 0) { throw new FormatException(); } if (stream.Mode == SerializeMode.Reading) { this.Mipmaps.Clear(); uint mipmapCount = 0; stream.SerializeValue(ref mipmapCount); for (uint i = 0; i < mipmapCount; i++) { var mip = new Mipmap(); stream.SerializeValue(ref mip.Width); stream.SerializeValue(ref mip.Height); stream.SerializeValue(ref mip.Unknown2); uint size = 0; stream.SerializeValue(ref size); stream.SerializeValue(ref mip.Data, size); this.Mipmaps.Add(mip); } } else { throw new NotSupportedException(); } uint unknown1 = 0; stream.SerializeValue(ref unknown1); if (unknown1 != 0) { throw new FormatException(); } byte unknown2 = 0; stream.SerializeValue(ref unknown2); if (unknown2 != 0) { throw new FormatException(); } }
public object Deserialize(IFileStream stream) { bool value = false; stream.SerializeValue(ref value); return value; }
public virtual void Serialize(IFileStream stream) { PropertySerializer.Serialize(this, stream); stream.SerializeValue(ref this.CObjectUnknown0); }
public object Deserialize(IFileStream stream) { float value = 0.0f; stream.SerializeValue(ref value); return value; }
public object Deserialize(IFileStream stream) { uint value = 0; stream.SerializeValue(ref value); return value; }
public override void Serialize(IFileStream stream) { var bytesRemaining = (uint) (stream.Length - stream.Position); stream.SerializeValue(ref _data, bytesRemaining); }
public override void Serialize(IFileStream stream) { var bytesRemaining = (uint)(stream.Length - stream.Position); stream.SerializeValue(ref _data, bytesRemaining); }
public object Deserialize(IFileStream stream) { string value = null; stream.SerializeValue(ref value); return value; }
public virtual void Serialize(IFileStream stream) { if (stream.Mode == SerializeMode.Reading) { PropertySerializer.Serialize(this, stream); stream.SerializeValue(ref _objectUnknown); } else { throw new NotSupportedException(); } }
public virtual void Serialize(IFileStream stream) { PropertySerializer.Serialize(this, stream); stream.SerializeValue(ref this.CObjectUnknown0); }
public object Deserialize(IFileStream stream) { Guid value = Guid.Empty; stream.SerializeValue(ref value); return value; }
private static void ReadGenericObjectProperty(GenericObject target, IFileStream stream, string type, uint size, string name) { IPropertySerializer serializer = GetSerializer(type); if (serializer != null) { target.SetProperty(name, type, serializer.Deserialize(stream)); } else { uint valueSize = size - 4; byte[] value = new byte[valueSize]; stream.SerializeValue(ref value, valueSize); target.SetProperty(name, type, value); } }