public struct ID : IComparable<ID>, IEquatable<ID>
An ID is used to uniquely identify a specific item.

Constructors

ID

#
public ID(string name, int index)
Constructor for IDs.
name (string)Name of id.
index (int)Index of id. Valid values are:

-1 = no index

0 to int.MaxValue = valid index

ID

#
public ID(string name)
Constuctor for IDs.
name (string)Name of id.

Properties

Hash

#
public int Hash { get; }
Gets the hash code.

HasIndex

#
public bool HasIndex { get; }
Gets whether the index has been set.

HasName

#
public bool HasName { get; }
Gets whether the name has been set. Every valid ID must have a name.

Index

#
public int Index { get; }
Gets the index of this ID, if there is no valid index then -1 is returned.

Name

#
public string Name { get; }
Gets the name of this ID.

Methods

CompareTo

#
public int CompareTo(ID other)
Compares this ID to another ID.
other (ID)The other ID.
Less than 0, if other comes before this. 0 is other is at the same place. More than zero otherwise.

Equals

#
public bool Equals(ID other)
Determines if two IDs are equal.
other (ID)The other ID.
true is both are equal.

GetHashCode

#
public override int GetHashCode()
Gets the hash code.
A number representing the hash code.

ToString

#
public override string ToString()
Gets a string representation for this ID.