Table of Contents

Struct EntityType

Namespace
Frent.Core
Assembly
Frent.dll

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

ImmutableArray<TagID>

Types

The component types

public readonly ImmutableArray<ComponentID> Types { get; }

Property Value

ImmutableArray<ComponentID>

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

EntityType

Equals(EntityType)

Checks if this EntityType represents the same ID as other

public readonly bool Equals(EntityType other)

Parameters

other EntityType

The EntityType to compare against

Returns

bool

true if they represent the same ID, false otherwise

Equals(object?)

Checks if this EntityType represents the same ID as obj

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare against

Returns

bool

true if they represent the same ID, false otherwise

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 ComponentID

The ID of the component type to check if this EntityType has

Returns

bool

true if this Entity type has a component of the specified component ID, false otherwise

HasTag(TagID)

Checks if this EntityType has a tag represented by a TagID

public readonly bool HasTag(TagID tagID)

Parameters

tagID TagID

The ID of the tag type to check if this EntityType has

Returns

bool

true if this Entity type has a tag of the specified tag ID, false otherwise

Operators

operator ==(EntityType, EntityType)

Checks if two EntityType instances represent the same ID

public static bool operator ==(EntityType left, EntityType right)

Parameters

left EntityType

The first EntityType

right EntityType

The second EntityType

Returns

bool

true if they represent the same ID, false otherwise

operator !=(EntityType, EntityType)

Checks if two EntityType instances represent different IDs

public static bool operator !=(EntityType left, EntityType right)

Parameters

left EntityType

The first EntityType

right EntityType

The second EntityType

Returns

bool

true if they represent different IDs, false otherwise