Table of Contents

Class YamlAssetPath

Namespace
Stride.Core.Assets.Yaml
Assembly
Stride.Core.Assets.dll

A class representing the path of a member or item of an Asset as it is created/consumed by the YAML asset serializers.

[DataContract]
public sealed class YamlAssetPath
Inheritance
YamlAssetPath

Constructors

YamlAssetPath()

Initializes a new instance of the YamlAssetPath class.

public YamlAssetPath()

YamlAssetPath(IEnumerable<Element>)

Initializes a new instance of the YamlAssetPath class.

public YamlAssetPath(IEnumerable<YamlAssetPath.Element> elements)

Parameters

elements IEnumerable<YamlAssetPath.Element>

The elements constituting this path, in proper order.

Properties

Elements

The elements constituting this path.

[DataMember]
public IReadOnlyList<YamlAssetPath.Element> Elements { get; }

Property Value

IReadOnlyList<YamlAssetPath.Element>

Methods

Append(YamlAssetPath)

Appends the given YamlAssetPath to this instance.

[Pure]
public YamlAssetPath Append(YamlAssetPath other)

Parameters

other YamlAssetPath

The YamlAssetPath

Returns

YamlAssetPath

A new instance of YamlAssetPath corresonding to the given instance appended to this instance.

Clone()

Creates a clone of this YamlAssetPath instance.

public YamlAssetPath Clone()

Returns

YamlAssetPath

A new copy of this YamlAssetPath.

FromMemberPath(MemberPath, object)

Creates a YamlAssetPath out of a Stride.Core.Reflection.MemberPath instance.

public static YamlAssetPath FromMemberPath(MemberPath path, object root)

Parameters

path MemberPath

The Stride.Core.Reflection.MemberPath from which to create a YamlAssetPath.

root object

The root object of the given Stride.Core.Reflection.MemberPath.

Returns

YamlAssetPath

An instance of YamlAssetPath corresponding to the same target than the given Stride.Core.Reflection.MemberPath.

Match(YamlAssetPath)

Indicates whether the current path represents the same path of another object.

public bool Match(YamlAssetPath other)

Parameters

other YamlAssetPath

An object to compare with this path.

Returns

bool

true if the current path matches the other parameter; otherwise, false.

Push(Element)

Adds an additional element.

public void Push(YamlAssetPath.Element element)

Parameters

element YamlAssetPath.Element

The YamlAssetPath.Element to add.

PushIndex(object)

Adds an additional element to the path representing an access to an item of a collection or a value of a dictionary that does not use ItemId.

public void PushIndex(object index)

Parameters

index object

The index of the item.

See Also

PushItemId(ItemId)

Adds an additional element to the path representing an access to an item of an collection or a value of a dictionary.

public void PushItemId(ItemId itemId)

Parameters

itemId ItemId

The ItemId of the item.

PushMember(string)

Adds an additional element to the path representing an access to a member of an object.

public void PushMember(string memberName)

Parameters

memberName string

The name of the member.

StartsWith(YamlAssetPath)

public bool StartsWith(YamlAssetPath path)

Parameters

path YamlAssetPath

Returns

bool

ToMemberPath(object)

Convert this YamlAssetPath into a Stride.Core.Reflection.MemberPath.

[Pure]
public MemberPath ToMemberPath(object root)

Parameters

root object

The actual instance that is root of this path.

Returns

MemberPath

An instance of Stride.Core.Reflection.MemberPath corresponding to the same target than this YamlAssetPath.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.