Vixen
02b45cc4
csharp
public readonly record struct ComponentTypeId

A component type's dense index, assigned by the generated type registry at module initialisation. Archetype masks, chunk layouts and query signatures are all keyed on it, so it needs to be small, contiguous, and comparable — which a Type is not.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Never persist this. The value depends on which assemblies were loaded and in what order, so it is stable within a process and meaningless outside one. Serialised data refers to component types by their Alias.

Ids are assigned from 1, so a zeroed struct is a detectably invalid handle rather than a silent alias for whichever component type happened to register first. Bit 0 of an archetype mask is unused; that is cheaper than the class of bug it removes.

Fields and properties (3)

  • public int Value
  • public static ComponentTypeId Invalid

    The id no component type has, and the value of an uninitialised handle.

  • public bool IsValid

    Whether this identifies a registered component type.

Methods (14)

  • public ComponentTypeId(int Value)

    A component type's dense index, assigned by the generated type registry at module initialisation. Archetype masks, chunk layouts and query signatures are all keyed on it, so it needs to be small, contiguous, and comparable — which a Type is not.

  • public int CompareTo(ComponentTypeId other)

    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 static bool operator <(ComponentTypeId left, ComponentTypeId right)

    Whether sorts before .

  • public static bool operator <=(ComponentTypeId left, ComponentTypeId right)

    Whether sorts before or equal to .

  • public static bool operator >(ComponentTypeId left, ComponentTypeId right)

    Whether sorts after .

  • public static bool operator >=(ComponentTypeId left, ComponentTypeId right)

    Whether sorts after or equal to .

  • public override string ToString()

    Renders the id as a decimal number.

  • public string ToString(string? format, IFormatProvider? formatProvider)

    Formats the value of the current instance using the specified format.

  • public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider? provider = null)

    Tries to format the value of the current instance into the provided span of characters.

  • public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider? provider = null)

    Tries to format the value of the current instance as UTF-8 into the provided span of bytes.

  • public static ComponentTypeId Parse(string s, IFormatProvider? provider = null)

    Parses a string into a value.

  • public static ComponentTypeId Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)

    Parses a span of characters into a value.

  • public static bool TryParse(string? s, IFormatProvider? provider, out ComponentTypeId result)

    Tries to parse a string into a value.

  • public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out ComponentTypeId result)

    Tries to parse a span of characters into a value.

Used by (50, showing 40)

  • Vixen_Samples_Multiplayer_CombatantReplicatorMultiplayer
  • Vixen_Samples_Multiplayer_VitalsReplicatorMultiplayer
  • ArchetypeVixen.Ecs
  • BuilderVixen.Ecs
  • ChannelVixen.Ecs
  • CommandVixen.Ecs
  • CommandBufferVixen.Ecs
  • ComponentRegistryVixen.Ecs
  • ComponentSignatureVixen.Ecs
  • ComponentTypeVixen.Ecs
  • ComponentTypeVixen.Ecs
  • ComponentTypeIdSerializerVixen.Core.Serialization
  • ComponentTypeTestsVixen.Ecs.Tests
  • ContractColumnVixen.Engine
  • DepthColumnVixen.Engine
  • HandWrittenTransformReplicatorVixen.Net.Generators.Tests
  • HealthReplicatorVixen.Net.Tests
  • IComponentReplicatorVixen.Net
  • ISceneComponentBinderVixen.Engine
  • IWorldColumnVixen.Engine
  • IdentityTestsVixen.Core.Tests
  • LocalTransformColumnVixen.Engine
  • NetworkAnimatorParametersReplicatorVixen.Net.Animation
  • NetworkAnimatorReplicatorVixen.Net.Animation
  • NetworkAudioSourceReplicatorVixen.Net.Audio
  • NetworkBonesReplicatorVixen.Net.Animation
  • NetworkRigidBodyReplicatorVixen.Net.Physics
  • NetworkSpawnReplicatorVixen.Net
  • NetworkTransformReplicatorVixen.Net
  • PositionReplicatorVixen.Net.Tests
  • PrefabVixen.Engine
  • QueryDescriptionVixen.Ecs
  • QueryOracleTestsVixen.Ecs.Tests
  • SceneComponentBinderVixen.Engine
  • SceneContentVixen.Engine
  • SceneTagColumnVixen.Engine
  • SyncListReplicatorVixen.Net.Engine
  • SyncStateReplicatorVixen.Net.Engine
  • SystemAccessVixen.Ecs
  • Vixen_Net_Generators_Tests_GeneratedPoseReplicatorVixen.Net.Generators.Tests