Archetype

public class Archetype

Defines a set of component types for entity grouping. Entities are organized into archetypes for cache-efficient iteration and querying. Each archetype represents a unique combination of component types.

java.lang.Object > Archetype

Field Summary

index

final int index

Field index.

component

final Component component

Field component.

typeClass

final Class typeClass

Field typeClass.

registry

final ComponentRegistry registry

Field registry.

minIndex

final int minIndex

Field minIndex.

newLength

final int newLength

Field newLength.

oldLength

final int oldLength

Field oldLength.

oldMinIndex

final int oldMinIndex

Field oldMinIndex.

oldMaxIndex

final int oldMaxIndex

Field oldMaxIndex.

newCount

final int newCount

Field newCount.

archetype

final Archetype archetype

Field archetype.

Method Detail

empty

static Archetype empty ()

Method empty.

Archetype

public private Archetype (final int minIndex, final int count, @Nonnull final ComponentType[] componentTypes)

Method Archetype.

Parameters:
final int minIndex
final int count
@Nonnull final ComponentType[] componentTypes

getMinIndex

public int getMinIndex ()

Method getMinIndex.

count

public int count ()

Method count.

length

public int length ()

Method length.

get

public ?> get (final int index)

Method get.

Parameters:
final int index

isEmpty

public boolean isEmpty ()

Method isEmpty.

contains

public boolean contains (@Nonnull final ComponentType componentType)

Method contains.

Parameters:
@Nonnull final ComponentType componentType

validateComponentType

public void validateComponentType (@Nonnull final ComponentType componentType)

Method validateComponentType.

Parameters:
@Nonnull final ComponentType componentType

IllegalArgumentException

public new IllegalArgumentException ("ComponentType is not in archetype: " + String.valueOf(componentType)

Method IllegalArgumentException.

Parameters:
"ComponentType is not in archetype: " + String.valueOf(componentType

validateComponents

public void validateComponents (@Nonnull final Component[] components, @Nullable final ComponentType> ignore)

Method validateComponents.

Parameters:
@Nonnull final Component[] components
@Nullable final ComponentType> ignore

IllegalStateException

public new IllegalStateException ("Invalid component at index " + index + " expected null but found " + String.valueOf(component.getClass()

Method IllegalStateException.

Parameters:
"Invalid component at index " + index + " expected null but found " + String.valueOf(component.getClass(

hasSerializableComponents

public boolean hasSerializableComponents (@Nonnull final ComponentRegistry.Data data)

Method hasSerializableComponents.

Parameters:
@Nonnull final ComponentRegistry.Data data

getSerializableArchetype

public Archetype getSerializableArchetype (@Nonnull final ComponentRegistry.Data data)

Method getSerializableArchetype.

Parameters:
@Nonnull final ComponentRegistry.Data data

asExactQuery

public ExactArchetypeQuery asExactQuery ()

Method asExactQuery.

of

static Archetype of (@Nonnull final ComponentType componentTypes)

Method of.

Parameters:
@Nonnull final ComponentType componentTypes

add

public Archetype add (@Nonnull final Archetype archetype, @Nonnull final ComponentType componentType)

Method add.

Parameters:
@Nonnull final Archetype archetype
@Nonnull final ComponentType componentType

remove

public Archetype remove (@Nonnull final Archetype archetype, @Nonnull final ComponentType componentType)

Method remove.

Parameters:
@Nonnull final Archetype archetype
@Nonnull final ComponentType componentType

test

public boolean test (@Nonnull final Archetype archetype)

Method test.

Parameters:
@Nonnull final Archetype archetype

requiresComponentType

public boolean requiresComponentType (@Nonnull final ComponentType componentType)

Method requiresComponentType.

Parameters:
@Nonnull final ComponentType componentType

validateRegistry

public void validateRegistry (final ComponentRegistry registry)

Method validateRegistry.

Parameters:
final ComponentRegistry registry

validate

public void validate ()

Method validate.

equals

public boolean equals (@Nullable final Object o)

Method equals.

Parameters:
@Nullable final Object o

hashCode

public int hashCode ()

Method hashCode.

toString

public String toString ()

Method toString.

See Also: