Contents
- Description
- Method Summary
- Method Details
- registerComponent(Class, Supplier)
- registerComponent(Class, String, BuilderCodec)
- registerResource(Class, Supplier)
- registerResource(Class, String, BuilderCodec)
- registerSystemType(Class)
- registerEntityEventType(Class)
- registerWorldEventType(Class)
- registerSystemGroup()
- registerSystem(ISystem)
- registerSpatialResource(Supplier)
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 Summary
Modifier and TypeMethodDescription<T extends Component<ECS_TYPE>>
ComponentType<ECS_TYPE, T> registerComponent(Class<? super T> tClass, String id, BuilderCodec<T> codec) Called to register a new component, providing the given class, id and codec.<T extends Component<ECS_TYPE>>
ComponentType<ECS_TYPE, T> registerComponent(Class<? super T> tClass, Supplier<T> supplier) Called to register a new component, providing the given class and constructor supplier.<T extends EcsEvent>
EntityEventType<ECS_TYPE, T> registerEntityEventType(Class<? super T> eventTypeClass) Called to register a new entity event type, providing the given class.<T extends Resource<ECS_TYPE>>
ResourceType<ECS_TYPE, T> registerResource(Class<? super T> tClass, String id, BuilderCodec<T> codec) Called to register a new resource, providing the given class, id and codec.<T extends Resource<ECS_TYPE>>
ResourceType<ECS_TYPE, T> registerResource(Class<? super T> tClass, Supplier<T> supplier) Called to register a new resource, providing the given class and constructor supplier.registerSpatialResource(Supplier<SpatialStructure<Ref<ECS_TYPE>>> supplier) Registers a spatial resource with the given supplier for creating spatial structures.voidregisterSystem(ISystem<ECS_TYPE> system) Called to register a new system, providing the given system instance.<T extends ISystem<ECS_TYPE>>
SystemType<ECS_TYPE, T> registerSystemType(Class<? super T> systemTypeClass) Called to register a new system type, providing the given class.<T extends EcsEvent>
WorldEventType<ECS_TYPE, T> registerWorldEventType(Class<? super T> eventTypeClass) Called to register a new world event type, providing the given class.
-
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
- Returns:
- A newly created system group instance.
-
registerSystem
-
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.
-