Class SerializedComponent
- Namespace
- KeenEyes.Serialization
- Assembly
- KeenEyes.Core.dll
Represents a serialized component with its type name and data.
public sealed record SerializedComponent : IEquatable<SerializedComponent>
- Inheritance
-
SerializedComponent
- Implements
- Inherited Members
Remarks
This record is used as part of the world snapshot system to store component data in a format suitable for JSON or binary serialization.
The type is stored as a fully-qualified assembly name to enable proper deserialization across different contexts.
Properties
Data
Gets or sets the serialized component data as a JSON element.
public JsonElement? Data { get; init; }
Property Value
Remarks
Component data is pre-serialized to JSON format using IComponentSerializer for Native AOT compatibility. This eliminates the need for reflection during JSON serialization.
Null for tag components which have no data.
IsTag
Gets or sets a value indicating whether this component is a tag component.
public bool IsTag { get; init; }
Property Value
Remarks
Tag components have no data and are used purely as markers. When true, the Data property may be null or empty.
TypeName
Gets or sets the fully-qualified type name of the component.
public required string TypeName { get; init; }
Property Value
Remarks
This should be the result of AssemblyQualifiedName to ensure proper type resolution during deserialization.