AssetCompositeHierarchy<TAssetPartDesign, TAssetPart> Class
Namespace: Stride.Core.AssetsAssembly: Stride.Core.Assets.dll
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. |
|
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> |
Methods
CollectParts()
[Obsolete("The AssetPart struct might be removed soon")]
public override IEnumerable<AssetPart> CollectParts()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<AssetPart> |
Overrides
ContainsPart(Guid)
public override bool ContainsPart(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | id |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
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
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
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. |