Table of Contents

Class FixupObjectReferences

Namespace
Stride.Core.Assets.Serializers
Assembly
Stride.Core.Assets.dll

A static class that can be used to fix up object references.

public static class FixupObjectReferences
Inheritance
FixupObjectReferences

Methods

CollectReferenceableObjects(object, YamlAssetMetadata<Guid>, bool, ILogger)

public static Dictionary<Guid, IIdentifiable> CollectReferenceableObjects(object root, YamlAssetMetadata<Guid> objectReferences, bool throwOnDuplicateIds, ILogger logger = null)

Parameters

root object
objectReferences YamlAssetMetadata<Guid>
throwOnDuplicateIds bool
logger ILogger

Returns

Dictionary<Guid, IIdentifiable>

FixupReferences(object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, bool, ILogger)

public static void FixupReferences(object root, YamlAssetMetadata<Guid> objectReferences, Dictionary<Guid, IIdentifiable> referenceTargets, bool clearMissingReferences, ILogger logger = null)

Parameters

root object
objectReferences YamlAssetMetadata<Guid>
referenceTargets Dictionary<Guid, IIdentifiable>
clearMissingReferences bool
logger ILogger

FixupReferences(object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, bool, Action<MemberPath, object, object>, ILogger)

public static void FixupReferences(object root, YamlAssetMetadata<Guid> objectReferences, Dictionary<Guid, IIdentifiable> referenceTargets, bool clearMissingReferences, Action<MemberPath, object, object> applyAction, ILogger logger = null)

Parameters

root object
objectReferences YamlAssetMetadata<Guid>
referenceTargets Dictionary<Guid, IIdentifiable>
clearMissingReferences bool
applyAction Action<MemberPath, object, object>
logger ILogger

RunFixupPass(object, YamlAssetMetadata<Guid>, bool, bool, ILogger)

Fix up references represented by the objectReferences dictionary into the root object, by visiting the object to find all IIdentifiable instances it references, and modify the references described by objectReferences to point to the proper identifiable object matching the same Guid.

public static void RunFixupPass(object root, YamlAssetMetadata<Guid> objectReferences, bool clearBrokenObjectReferences, bool throwOnDuplicateIds, ILogger logger = null)

Parameters

root object

The root object to fix up.

objectReferences YamlAssetMetadata<Guid>

The path to each object reference and the Guid of the tar

clearBrokenObjectReferences bool

If true, any object refernce that cannot be resolved will be reset to null.

throwOnDuplicateIds bool

If true, an exception will be thrown if two IIdentifiable

logger ILogger

An optional logger.