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 Details

    • EMPTY_ARRAY

      @Nonnull public static final SystemType[] EMPTY_ARRAY
      An empty array of system types, for reduced allocations.
  • Method Details

    • getRegistry

      @Nonnull public ComponentRegistry<ECS_TYPE> getRegistry()
      The registry this component type is part of.
      Returns:
      the associated component registry.
    • getTypeClass

      public Class<? super T> getTypeClass()
      Returns:
      The class type of the system.
    • isType

      public boolean isType(@Nonnull ISystem<ECS_TYPE> system)
      Determines whether the given system is of this type.
      Parameters:
      system - The system to check.
      Returns:
      true if the system is of this type, false otherwise.
    • getIndex

      public int getIndex()
      Get the index for this registered system type.
      Returns:
      The index for this system type
    • validateRegistry

      public void validateRegistry(@Nonnull ComponentRegistry<ECS_TYPE> registry)
      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

      public int compareTo(@Nonnull SystemType<ECS_TYPE,?> o)
      Specified by:
      compareTo in interface Comparable<ECS_TYPE>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object