Table of Contents

Struct ItemId

Namespace
Stride.Core.Reflection
Assembly
Stride.Core.Assets.dll

Represents the identifier of an item in a collection or an entry in a dictionary.

[DataContract]
public struct ItemId : IComparable<ItemId>, IEquatable<ItemId>
Implements

Constructors

ItemId(ObjectId)

Initializes a new instance of the ItemId structure from an ObjectId.

public ItemId(ObjectId id)

Parameters

id ObjectId

The ObjectId from which to create this ItemId.

ItemId(byte[])

Initializes a new instance of the ItemId structure from an array of bytes.

public ItemId(byte[] bytes)

Parameters

bytes byte[]

The array of bytes from which to create this ItemId.

Properties

Empty

Gets an ItemId representing an empty or non-existing item.

public static ItemId Empty { get; }

Property Value

ItemId

Methods

CompareTo(ItemId)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(ItemId other)

Parameters

other ItemId

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(ItemId)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ItemId other)

Parameters

other ItemId

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

New()

Generates a new random ItemId.

public static ItemId New()

Returns

ItemId

Parse(string)

Parses an ItemId from a string.

public static ItemId Parse(string input)

Parameters

input string

The input string to parse.

Returns

ItemId

An ItemId corresponding to the parsed string.

Exceptions

FormatException

The given string cannot be parsed as an ItemId.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

TryParse(string, out ItemId)

Attempts to parse an ItemId from a string.

public static bool TryParse(string input, out ItemId itemId)

Parameters

input string

The input string to parse.

itemId ItemId

The resulting ItemId.

Returns

bool

True if the string could be successfully parsed, False otherwise.

Operators

operator ==(ItemId, ItemId)

public static bool operator ==(ItemId left, ItemId right)

Parameters

left ItemId
right ItemId

Returns

bool

operator !=(ItemId, ItemId)

public static bool operator !=(ItemId left, ItemId right)

Parameters

left ItemId
right ItemId

Returns

bool