Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    AssetCompositeHierarchy<TAssetPartDesign, TAssetPart> Class

    Namespace: Stride.Core.Assets
    Assembly: Stride.Core.Assets.dll
    System.Object → Asset → AssetComposite → AssetCompositeHierarchy<TAssetPartDesign, TAssetPart>
    Derived from AssetCompositeHierarchy<TAssetPartDesign, TAssetPart>:

    public abstract class AssetCompositeHierarchy<TAssetPartDesign, TAssetPart> : AssetComposite, IAssetComposite where TAssetPartDesign : class, IAssetPartDesign<TAssetPart> where TAssetPart : class, IIdentifiable
    Type Parameters
    Name Description
    TAssetPartDesign
    TAssetPart
    Name Description
    Properties
    Hierarchy

    Gets or sets the container of the hierarchy of asset parts.

    Methods
    CollectParts()
    ContainsPart(Guid)
    CreateDerivedAsset(String, out Dictionary<Guid, Guid>)

    Creates an asset that inherits from this asset.

    EnumerateChildPartDesigns(TAssetPartDesign, AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>, Boolean)

    Enumerates design parts that are children of the given design part.

    EnumerateChildParts(TAssetPart, Boolean)

    Enumerates parts that are children of the given part.

    FindPart(Guid)
    GetChild(TAssetPart, Int32)

    Gets the child of the given part that matches the given index.

    GetChildCount(TAssetPart)

    Gets the number of children in the given part.

    GetParent(TAssetPart)

    Gets the parent of the given part.

    IndexOf(TAssetPart)

    Gets the index of the given part in the child list of its parent, or in the list of root if this part is a root part.

    | Improve this Doc View Source

    Properties


    Hierarchy

    Gets or sets the container of the hierarchy of asset parts.

    [DataMember(100)]
    [Display(null, null, Browsable = false)]
    public AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart> Hierarchy { get; set; }
    Property Value
    Type Description
    AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>
    | Improve this Doc View Source

    Methods


    CollectParts()

    [Obsolete("The AssetPart struct might be removed soon")]
    public override IEnumerable<AssetPart> CollectParts()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<AssetPart>
    Overrides
    AssetComposite.CollectParts()

    ContainsPart(Guid)

    public override bool ContainsPart(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    Returns
    Type Description
    System.Boolean
    Overrides
    AssetComposite.ContainsPart(Guid)

    CreateDerivedAsset(String, out Dictionary<Guid, Guid>)

    Creates an asset that inherits from this asset.

    public override Asset CreateDerivedAsset(string baseLocation, out Dictionary<Guid, Guid> idRemapping)
    Parameters
    Type Name Description
    System.String baseLocation

    The location of this asset.

    System.Collections.Generic.Dictionary<System.Guid, System.Guid> idRemapping

    A dictionary in which will be stored all the System.Guid remapping done for the child asset.

    Returns
    Type Description
    Asset

    An asset that inherits this asset instance

    Overrides
    Asset.CreateDerivedAsset(String, out Dictionary<Guid, Guid>)

    EnumerateChildPartDesigns(TAssetPartDesign, AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>, Boolean)

    Enumerates design parts that are children of the given design part.

    [Pure]
    public IEnumerable<TAssetPartDesign> EnumerateChildPartDesigns(TAssetPartDesign partDesign, AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart> hierarchyData, bool isRecursive)
    Parameters
    Type Name Description
    TAssetPartDesign partDesign

    The design part for which to enumerate child parts.

    AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart> hierarchyData

    The hierarchy data object in which the design parts can be retrieved.

    System.Boolean isRecursive

    If true, child design parts will be enumerated recursively.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TAssetPartDesign>

    A sequence containing the child design parts of the given design part.


    EnumerateChildParts(TAssetPart, Boolean)

    Enumerates parts that are children of the given part.

    [Pure]
    public abstract IEnumerable<TAssetPart> EnumerateChildParts(TAssetPart part, bool isRecursive)
    Parameters
    Type Name Description
    TAssetPart part

    The part for which to enumerate child parts.

    System.Boolean isRecursive

    If true, child parts will be enumerated recursively.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TAssetPart>

    A sequence containing the child parts of the given part.

    Remarks

    Implementations of this method should not rely on the Hierarchy property to enumerate.


    FindPart(Guid)

    public override IIdentifiable FindPart(Guid partId)
    Parameters
    Type Name Description
    System.Guid partId
    Returns
    Type Description
    IIdentifiable
    Overrides
    AssetComposite.FindPart(Guid)

    GetChild(TAssetPart, Int32)

    Gets the child of the given part that matches the given index.

    [Pure]
    public abstract TAssetPart GetChild(TAssetPart part, int index)
    Parameters
    Type Name Description
    TAssetPart part

    The part for which to retrieve a child.

    System.Int32 index

    The index of the child to retrieve.

    Returns
    Type Description
    TAssetPart

    The the child of the given part that matches the given index.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The given part is null.

    System.IndexOutOfRangeException

    The given index is out of range.


    GetChildCount(TAssetPart)

    Gets the number of children in the given part.

    [Pure]
    public abstract int GetChildCount(TAssetPart part)
    Parameters
    Type Name Description
    TAssetPart part

    The part for which to retrieve the number of children.

    Returns
    Type Description
    System.Int32

    The number of children in the given part.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The given part is null.


    GetParent(TAssetPart)

    Gets the parent of the given part.

    public abstract TAssetPart GetParent(TAssetPart part)
    Parameters
    Type Name Description
    TAssetPart part
    Returns
    Type Description
    TAssetPart

    The part that is the parent of the given part, or null if the given part is at the root level.

    Remarks

    Implementations of this method should not rely on the Hierarchy property to determine the parent.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The given part is null.


    IndexOf(TAssetPart)

    Gets the index of the given part in the child list of its parent, or in the list of root if this part is a root part.

    [Pure]
    public abstract int IndexOf(TAssetPart part)
    Parameters
    Type Name Description
    TAssetPart part

    The part for which to retrieve the index.

    Returns
    Type Description
    System.Int32

    The index of the part, or a negative value if the part is an orphan part that is not a member of this asset.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The given part is null.


    Inherited Members

    Asset.Id
    Asset.SerializedVersion
    Asset.Tags
    Asset.Archetype
    Asset.MainSource
    Asset.CreateDerivedAsset(String)
    Asset.ToString()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

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