Struct EntityType
Represents an entity's type, or set of component and tag types that make it up
public struct EntityType : IEquatable<EntityType>
- Implements
- Inherited Members
Properties
Tags
The tag types
public readonly ImmutableArray<TagID> Tags { get; }
Property Value
Types
The component types
public readonly ImmutableArray<ComponentID> Types { get; }
Property Value
Methods
EntityTypeOf(ReadOnlySpan<ComponentID>, ReadOnlySpan<TagID>)
Gets an EntityType without needing an Entity of the specific type.
public static EntityType EntityTypeOf(ReadOnlySpan<ComponentID> components, ReadOnlySpan<TagID> tags)
Parameters
components
ReadOnlySpan<ComponentID>The components the EntityType should have.
tags
ReadOnlySpan<TagID>The tags the EntityType should have.
Returns
Equals(EntityType)
Checks if this EntityType represents the same ID as other
public readonly bool Equals(EntityType other)
Parameters
other
EntityTypeThe EntityType to compare against
Returns
Equals(object?)
Checks if this EntityType represents the same ID as obj
public override readonly bool Equals(object? obj)
Parameters
obj
objectThe object to compare against
Returns
GetHashCode()
Gets the hash code for this EntityType
public override readonly int GetHashCode()
Returns
- int
An integer hash code representing this EntityType
HasComponent(ComponentID)
Checks if this EntityType has a component represented by a ComponentID
public readonly bool HasComponent(ComponentID componentID)
Parameters
componentID
ComponentIDThe ID of the component type to check if this EntityType has
Returns
HasTag(TagID)
Checks if this EntityType has a tag represented by a TagID
public readonly bool HasTag(TagID tagID)
Parameters
tagID
TagIDThe ID of the tag type to check if this EntityType has
Returns
Operators
operator ==(EntityType, EntityType)
Checks if two EntityType instances represent the same ID
public static bool operator ==(EntityType left, EntityType right)
Parameters
left
EntityTypeThe first EntityType
right
EntityTypeThe second EntityType
Returns
operator !=(EntityType, EntityType)
Checks if two EntityType instances represent different IDs
public static bool operator !=(EntityType left, EntityType right)
Parameters
left
EntityTypeThe first EntityType
right
EntityTypeThe second EntityType