Struct ComponentId
- Namespace
- KeenEyes
- Assembly
- KeenEyes.Core.dll
Unique identifier for a component type.
public readonly record struct ComponentId : IComparable<ComponentId>, IEquatable<ComponentId>
- Implements
- Inherited Members
Constructors
ComponentId(int)
Unique identifier for a component type.
public ComponentId(int Value)
Parameters
ValueintThe underlying integer identifier.
Fields
None
An invalid/unassigned component ID.
public static readonly ComponentId None
Field Value
Properties
IsValid
Whether this ID is valid.
public bool IsValid { get; }
Property Value
Value
The underlying integer identifier.
public int Value { get; init; }
Property Value
Methods
CompareTo(ComponentId)
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(ComponentId other)
Parameters
otherComponentIdAn 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 otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin the sort order.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
implicit operator int(ComponentId)
Converts a ComponentId to its underlying integer value.
public static implicit operator int(ComponentId id)
Parameters
idComponentIdThe component ID.