Table of Contents

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

Value int

The underlying integer identifier.

Fields

None

An invalid/unassigned component ID.

public static readonly ComponentId None

Field Value

ComponentId

Properties

IsValid

Whether this ID is valid.

public bool IsValid { get; }

Property Value

bool

Value

The underlying integer identifier.

public int Value { get; init; }

Property Value

int

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

other ComponentId

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.

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

id ComponentId

The component ID.

Returns

int