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
componentsReadOnlySpan<ComponentID>The components the EntityType should have.
tagsReadOnlySpan<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
otherEntityTypeThe 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
objobjectThe 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
componentIDComponentIDThe 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
tagIDTagIDThe 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
leftEntityTypeThe first EntityType
rightEntityTypeThe second EntityType
Returns
operator !=(EntityType, EntityType)
Checks if two EntityType instances represent different IDs
public static bool operator !=(EntityType left, EntityType right)
Parameters
leftEntityTypeThe first EntityType
rightEntityTypeThe second EntityType