Contents
Class SystemType<ECS_TYPE, T extends ISystem<ECS_TYPE>>
java.lang.Object
com.hypixel.hytale.component.SystemType<ECS_TYPE,T>
- Type Parameters:
ECS_TYPE- The type of ECS this system type is part of.T- The type of system this system type represents.
- All Implemented Interfaces:
Comparable<SystemType<ECS_TYPE,?>>
- Direct Known Subclasses:
EventSystemType
public class SystemType<ECS_TYPE, T extends ISystem<ECS_TYPE>>
extends Object
implements Comparable<SystemType<ECS_TYPE,?>>
Describes a system type registered with a
ComponentRegistry.
A system type is a class that extends ISystem and can be implemented by multiple systems.
This allows for looking up a group of systems by index.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemType[]An empty array of system types, for reduced allocations. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SystemType<ECS_TYPE, ?> o) booleanintgetIndex()Get the index for this registered system type.The registry this component type is part of.inthashCode()booleanDetermines whether the given system is of this type.toString()voidvalidate()Called to validate that this system type is still valid.voidvalidateRegistry(ComponentRegistry<ECS_TYPE> registry) Called to validate that this system type is for the given registry.
-
Field Details
-
EMPTY_ARRAY
An empty array of system types, for reduced allocations.
-
-
Method Details
-
getRegistry
The registry this component type is part of.- Returns:
- the associated component registry.
-
getTypeClass
-
isType
-
getIndex
public int getIndex()Get the index for this registered system type.- Returns:
- The index for this system type
-
validateRegistry
Called to validate that this system type is for the given registry.- Parameters:
registry- The registry to validate against.- Throws:
IllegalArgumentException- if the registry does not match.
-
validate
public void validate()Called to validate that this system type is still valid.- Throws:
IllegalStateException- if the system type has been invalidated.
-
compareTo
- Specified by:
compareToin interfaceComparable<ECS_TYPE>
-
equals
-
hashCode
-
toString
-