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)
public ItemId(ObjectId id)
Parameters
ItemId(byte[])
Initializes a new instance of the ItemId structure from an array of bytes.
public ItemId(byte[] bytes)
Parameters
Properties
Empty
Gets an ItemId representing an empty or non-existing item.
public static ItemId Empty { get; }
Property Value
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
ItemIdAn 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
ItemIdAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe 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
Parse(string)
Parses an ItemId from a string.
public static ItemId Parse(string input)
Parameters
input
stringThe input string to parse.
Returns
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
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
Returns
operator !=(ItemId, ItemId)
public static bool operator !=(ItemId left, ItemId right)