Contents
Class System<ECS_TYPE>
java.lang.Object
com.hypixel.hytale.component.system.System<ECS_TYPE>
- Type Parameters:
ECS_TYPE- The type of ECS this system belongs to.
- All Implemented Interfaces:
ISystem<ECS_TYPE>
- Direct Known Subclasses:
ArchetypeChunkSystem, ArchetypeDataSystem, HolderSystem, RefChangeSystem, RefSystem, StoreSystem, TickingSystem
An abstract implementation of a component system with support for registering its own components and resources.
TODO: At the moment we must still have the ISystem interface so we can correctly identify classes such as with `registerSystemType(QuerySystem.class)` This could be improved by using a special interface for SystemType's or by just allowing any interface/class
-
Field Summary
Fields inherited from interface ISystem
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Resource<ECS_TYPE>>
ResourceType<ECS_TYPE, T> registerResource(Class<? super T> tClass, String id, BuilderCodec<T> codec) Registers the given resource under this system.<T extends Resource<ECS_TYPE>>
ResourceType<ECS_TYPE, T> registerResource(Class<? super T> tClass, Supplier<T> supplier) Registers the given resource under this system.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISystem
getDependencies, getGroup, onSystemRegistered, onSystemUnregistered
-
Constructor Details
-
System
public System()
-
-
Method Details
-
registerResource
@Nonnull public <T extends Resource<ECS_TYPE>> ResourceType<ECS_TYPE,T> registerResource(@Nonnull Class<? super T> tClass, @Nonnull Supplier<T> supplier) Registers the given resource under this system.- Type Parameters:
T- The store type.- Parameters:
tClass- The class type of the resource.supplier- The supplier used to build resource instances.- Returns:
- the resource type of the registered resource.
-
registerResource
@Nonnull public <T extends Resource<ECS_TYPE>> ResourceType<ECS_TYPE,T> registerResource(@Nonnull Class<? super T> tClass, @Nonnull String id, @Nonnull BuilderCodec<T> codec) Registers the given resource under this system.- Type Parameters:
T- The store type.- Parameters:
tClass- The class type of the resource.id- The unique identifier for the resource.codec- The codec builder used to read/write the resource.- Returns:
- the resource type of the registered resource.
-
getComponentRegistrations
- Returns:
- the list of components registered under this system.
-
getResourceRegistrations
- Returns:
- the list of resources registered under this system.
-