Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    FixupObjectReferences Class

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

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

    System.Object → FixupObjectReferences
    Derived from FixupObjectReferences:

    public static class FixupObjectReferences
    Name Description
    Methods
    CollectReferenceableObjects(Object, YamlAssetMetadata<Guid>, Boolean, ILogger)
    FixupReferences(Object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, Boolean, ILogger)
    FixupReferences(Object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, Boolean, Action<MemberPath, Object, Object>, ILogger)
    RunFixupPass(Object, YamlAssetMetadata<Guid>, Boolean, Boolean, 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 System.Guid.

    | Improve this Doc View Source

    Methods


    CollectReferenceableObjects(Object, YamlAssetMetadata<Guid>, Boolean, ILogger)

    public static Dictionary<Guid, IIdentifiable> CollectReferenceableObjects(object root, YamlAssetMetadata<Guid> objectReferences, bool throwOnDuplicateIds, ILogger logger = null)
    Parameters
    Type Name Description
    System.Object root
    YamlAssetMetadata<System.Guid> objectReferences
    System.Boolean throwOnDuplicateIds
    ILogger logger
    Returns
    Type Description
    System.Collections.Generic.Dictionary<System.Guid, IIdentifiable>

    FixupReferences(Object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, Boolean, ILogger)

    public static void FixupReferences(object root, YamlAssetMetadata<Guid> objectReferences, Dictionary<Guid, IIdentifiable> referenceTargets, bool clearMissingReferences, ILogger logger = null)
    Parameters
    Type Name Description
    System.Object root
    YamlAssetMetadata<System.Guid> objectReferences
    System.Collections.Generic.Dictionary<System.Guid, IIdentifiable> referenceTargets
    System.Boolean clearMissingReferences
    ILogger logger

    FixupReferences(Object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, Boolean, 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
    Type Name Description
    System.Object root
    YamlAssetMetadata<System.Guid> objectReferences
    System.Collections.Generic.Dictionary<System.Guid, IIdentifiable> referenceTargets
    System.Boolean clearMissingReferences
    System.Action<Stride.Core.Reflection.MemberPath, System.Object, System.Object> applyAction
    ILogger logger

    RunFixupPass(Object, YamlAssetMetadata<Guid>, Boolean, Boolean, 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 System.Guid.

    public static void RunFixupPass(object root, YamlAssetMetadata<Guid> objectReferences, bool clearBrokenObjectReferences, bool throwOnDuplicateIds, ILogger logger = null)
    Parameters
    Type Name Description
    System.Object root

    The root object to fix up.

    YamlAssetMetadata<System.Guid> objectReferences

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

    System.Boolean clearBrokenObjectReferences

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

    System.Boolean throwOnDuplicateIds

    If true, an exception will be thrown if two IIdentifiable

    ILogger logger

    An optional logger.


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation