Contents
Class ComponentType<ECS_TYPE, T extends Component<ECS_TYPE>>
java.lang.Object
com.hypixel.hytale.component.ComponentType<ECS_TYPE,T>
- Type Parameters:
ECS_TYPE- The store type associated with this component type.T- The component type class.
- All Implemented Interfaces:
Query<ECS_TYPE>, Comparable<ComponentType<ECS_TYPE,?>>
public class ComponentType<ECS_TYPE, T extends Component<ECS_TYPE>>
extends Object
implements Comparable<ComponentType<ECS_TYPE,?>>, Query<ECS_TYPE>
Represents a type of
Component class, registered via a ComponentRegistry and used as a key to fetch components.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ComponentType[]An empty component type array to reduce allocation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ComponentType<ECS_TYPE, ?> o) booleanintgetIndex()Get the index for this registered component type.inthashCode()booleanrequiresComponentType(ComponentType<ECS_TYPE, ?> componentType) Controls if a query requires a component and so if used by a system it should be automatically unregistered if a component type is removed.booleanControls if this query should process the providedArchetype.toString()voidvalidate()Validates the internal state of this query.voidvalidateRegistry(ComponentRegistry<ECS_TYPE> registry) Validates that the providedComponentRegistryis compatible with this query.
-
Field Details
-
EMPTY_ARRAY
An empty component type array to reduce allocation.
-
-
Constructor Details
-
ComponentType
public ComponentType()Default Constructor for aComponentTypeinstance.
-
-
Method Details
-
getRegistry
- Returns:
- the registry that this component type is associated with.
-
getTypeClass
-
getIndex
public int getIndex()Get the index for this registered component type.- Returns:
- The index for this component.
-
test
-
requiresComponentType
Description copied from interface:QueryControls if a query requires a component and so if used by a system it should be automatically unregistered if a component type is removed.- Specified by:
requiresComponentTypein interfaceQuery<ECS_TYPE>- Returns:
trueif thecomponentTypeis required.
-
validateRegistry
Description copied from interface:QueryValidates that the providedComponentRegistryis compatible with this query.- Specified by:
validateRegistryin interfaceQuery<ECS_TYPE>- Parameters:
registry- The component registry to validate against.
-
validate
-
compareTo
- Specified by:
compareToin interfaceComparable<ECS_TYPE>
-
equals
-
hashCode
-
toString
-