Class SerializedEntity
- Namespace
- KeenEyes.Serialization
- Assembly
- KeenEyes.Core.dll
Represents a serialized entity with its ID, name, components, and hierarchy information.
public sealed record SerializedEntity : IEquatable<SerializedEntity>
- Inheritance
-
SerializedEntity
- Implements
- Inherited Members
Remarks
This record captures the complete state of an entity for serialization purposes. It includes all components attached to the entity, optional naming information, and parent-child relationships for hierarchy reconstruction.
Properties
Components
Gets or sets the collection of serialized components attached to this entity.
public required IReadOnlyList<SerializedComponent> Components { get; init; }
Property Value
Remarks
This includes both regular components with data and tag components.
Id
Gets or sets the entity's unique identifier within the snapshot.
public required int Id { get; init; }
Property Value
Remarks
This ID is used to maintain entity references during serialization and to reconstruct hierarchy relationships during deserialization. Note that the actual entity IDs after restoration may differ.
Name
Gets or sets the optional name of the entity.
public string? Name { get; init; }
Property Value
Remarks
Entity names must be unique within a world. If null, the entity is unnamed.
ParentId
Gets or sets the ID of this entity's parent, or null if it has no parent.
public int? ParentId { get; init; }
Property Value
- int?
Remarks
This references the Id of another SerializedEntity in the same snapshot. During restoration, parent-child relationships are reconstructed using these references.