Interface IComponentRegistry<ECS_TYPE>

Type Parameters:
ECS_TYPE - The type of ECS instance the registry is associated with.
All Known Implementing Classes:
ComponentRegistry, ComponentRegistryProxy

public interface IComponentRegistry<ECS_TYPE>
An interface for a class that can register a variety of ECS objects.
  • Method Details

    • registerComponent

      @Nonnull <T extends Component<ECS_TYPE>> ComponentType<ECS_TYPE,T> registerComponent(@Nonnull Class<? super T> tClass, @Nonnull Supplier<T> supplier)
      Called to register a new component, providing the given class and constructor supplier.
      Type Parameters:
      T - The type of the component.
      Parameters:
      tClass - The class of the component to register.
      supplier - The supplier to use to create new instances of the component.
      Returns:
      The registered component type.
    • registerComponent

      @Nonnull <T extends Component<ECS_TYPE>> ComponentType<ECS_TYPE,T> registerComponent(@Nonnull Class<? super T> tClass, @Nonnull String id, @Nonnull BuilderCodec<T> codec)
      Called to register a new component, providing the given class, id and codec.

      The codec allows for serialization and deserialization of the component, enabling it to be saved and loaded as needed.

      Type Parameters:
      T - The type of the component.
      Parameters:
      tClass - The class of the component to register.
      id - The unique identifier for the component.
      codec - The codec used for serialization and deserialization of the component.
      Returns:
      The registered component type.
    • registerResource

      @Nonnull <T extends Resource<ECS_TYPE>> ResourceType<ECS_TYPE,T> registerResource(@Nonnull Class<? super T> tClass, @Nonnull Supplier<T> supplier)
      Called to register a new resource, providing the given class and constructor supplier.
      Type Parameters:
      T - The type of the resource.
      Parameters:
      tClass - The class of the resource to register.
      supplier - The supplier to use to create new instances of the resource.
      Returns:
      The registered resource type.
    • registerResource

      @Nonnull <T extends Resource<ECS_TYPE>> ResourceType<ECS_TYPE,T> registerResource(@Nonnull Class<? super T> tClass, @Nonnull String id, @Nonnull BuilderCodec<T> codec)
      Called to register a new resource, providing the given class, id and codec.
      Type Parameters:
      T - The type of the resource.
      Parameters:
      tClass - The class of the resource to register.
      id - The unique identifier for the resource.
      codec - The codec used for serialization and deserialization of the resource.
      Returns:
      The registered resource type.
    • registerSystemType

      <T extends ISystem<ECS_TYPE>> SystemType<ECS_TYPE,T> registerSystemType(@Nonnull Class<? super T> systemTypeClass)
      Called to register a new system type, providing the given class.
      Type Parameters:
      T - The type of the system.
      Parameters:
      systemTypeClass - The class of the system type to register.
      Returns:
      The registered system type.
    • registerEntityEventType

      @Nonnull <T extends EcsEvent> EntityEventType<ECS_TYPE,T> registerEntityEventType(@Nonnull Class<? super T> eventTypeClass)
      Called to register a new entity event type, providing the given class.
      Type Parameters:
      T - The type of the event.
      Parameters:
      eventTypeClass - The class of the event type to register.
      Returns:
      The registered entity event type.
    • registerWorldEventType

      @Nonnull <T extends EcsEvent> WorldEventType<ECS_TYPE,T> registerWorldEventType(@Nonnull Class<? super T> eventTypeClass)
      Called to register a new world event type, providing the given class.
      Type Parameters:
      T - The type of the event.
      Parameters:
      eventTypeClass - The class of the event type to register.
      Returns:
      The registered world event type.
    • registerSystemGroup

      @Nonnull SystemGroup<ECS_TYPE> registerSystemGroup()
      Returns:
      A newly created system group instance.
    • registerSystem

      void registerSystem(@Nonnull ISystem<ECS_TYPE> system)
      Called to register a new system, providing the given system instance.
      Parameters:
      system - The system instance to register.
    • registerSpatialResource

      ResourceType<ECS_TYPE, SpatialResource<Ref<ECS_TYPE>, ECS_TYPE>> registerSpatialResource(@Nonnull Supplier<SpatialStructure<Ref<ECS_TYPE>>> supplier)
      Registers a spatial resource with the given supplier for creating spatial structures.
      Parameters:
      supplier - The supplier that provides instances of SpatialStructure.
      Returns:
      The registered spatial resource type.