Table of Contents

Class ContentSerializerBase<T>

Namespace
Stride.Core.Serialization.Contents
Assembly
Stride.Core.Serialization.dll

Base class for Content Serializer with empty virtual implementation.

public class ContentSerializerBase<T> : IContentSerializer<T>, IContentSerializer

Type Parameters

T

Runtime type being serialized.

Inheritance
ContentSerializerBase<T>
Implements
Derived

Properties

ActualType

Gets the actual runtime type of object being serialized by Serialize(ContentSerializerContext, SerializationStream, object). It could be different than SerializationType if a conversion happened.

public virtual Type ActualType { get; }

Property Value

Type

The actual type.

SerializationType

Gets the type stored on HDD. Usually matches ActualType, but sometimes it might be converted to a different format (i.e. a GPU Texture is saved as an Image).

public virtual Type SerializationType { get; }

Property Value

Type

The type stored on HDD.

Methods

Construct(ContentSerializerContext)

Constructs the specified object. This is useful if there is any cycle in the object graph reference.

public virtual object Construct(ContentSerializerContext context)

Parameters

context ContentSerializerContext

The context.

Returns

object

The newly built object.

Serialize(ContentSerializerContext, SerializationStream, object)

Serializes the specified object.

public void Serialize(ContentSerializerContext context, SerializationStream stream, object obj)

Parameters

context ContentSerializerContext

The context.

stream SerializationStream

The stream.

obj object

The object.

Serialize(ContentSerializerContext, SerializationStream, T)

public virtual void Serialize(ContentSerializerContext context, SerializationStream stream, T obj)

Parameters

context ContentSerializerContext
stream SerializationStream
obj T