Package com.hypixel.hytale.component
Class Store<ECS_TYPE>
java.lang.Object
com.hypixel.hytale.component.Store<ECS_TYPE>
- All Implemented Interfaces:
ComponentAccessor<ECS_TYPE>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BitSet[]private final BitSetprivate ArchetypeChunk<ECS_TYPE>[]private intprivate final Deque<CommandBuffer<ECS_TYPE>> private booleanDeprecated, for removal: This API element is subject to removal in a future version.static final Store[]private intprivate int[]private int[]private final ECS_TYPEprivate final ParallelTask<EntityDataSystem.SystemTaskData<ECS_TYPE, ?, ?>> private final ParallelTask<ForEachTaskData<ECS_TYPE>> static final MetricsRegistry<Store<?>> private final ParallelTask<EntityTickingSystem.SystemTaskData<ECS_TYPE>> private final Store.ProcessingCounterprivate final ComponentRegistry<ECS_TYPE> private final IResourceStorageprivate boolean(package private) intprivate BitSet[]private HistoricMetric[]private final Thread -
Constructor Summary
ConstructorsConstructorDescriptionStore(ComponentRegistry<ECS_TYPE> registry, int storeIndex, ECS_TYPE externalData, IResourceStorage resourceStorage) -
Method Summary
Modifier and TypeMethodDescription__internal_getComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) __internal_getResource(ResourceType<ECS_TYPE, T> resourceType) addComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) addComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType, T component) addEntities(Holder<ECS_TYPE>[] holders, int start, int length, AddReason reason) voidaddEntities(Holder<ECS_TYPE>[] holders, int holderStart, Ref<ECS_TYPE>[] refs, int refStart, int length, AddReason reason) addEntities(Holder<ECS_TYPE>[] holders, AddReason reason) voidvoidvoidcopyEntity(Ref<ECS_TYPE> ref) copyEntity(Ref<ECS_TYPE> ref, Holder<ECS_TYPE> holder) copySerializableEntity(Ref<ECS_TYPE> ref, Holder<ECS_TYPE> holder) datachunk_addComponent(Ref<ECS_TYPE> ref, int fromArchetypeIndex, ComponentType<ECS_TYPE, T> componentType, T component, CommandBuffer<ECS_TYPE> commandBuffer) ensureAndGetComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) ensureComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) <T extends ArchetypeDataSystem<ECS_TYPE,Q, R>, Q, R>
voidfetch(SystemType<ECS_TYPE, T> systemType, Q query, List<R> results) <T extends EntityDataSystem<ECS_TYPE,Q, R>, Q, R>
voidfetch(Collection<Ref<ECS_TYPE>> refs, SystemType<ECS_TYPE, T> systemType, Q query, List<R> results) private intfindOrCreateArchetypeChunk(Archetype<ECS_TYPE> archetype) voidforEachChunk(int systemIndex, BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) booleanforEachChunk(int systemIndex, BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) voidforEachChunk(Query<ECS_TYPE> query, BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) booleanforEachChunk(Query<ECS_TYPE> query, BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) voidforEachChunk(BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) booleanforEachChunk(BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) voidforEachEntityParallel(Query<ECS_TYPE> query, IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) voidforEachEntityParallel(IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) getArchetype(Ref<ECS_TYPE> ref) intintgetArchetypeChunkCountFor(int systemIndex) getComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) intintgetEntityCountFor(int systemIndex) intgetEntityCountFor(Query<ECS_TYPE> query) getResource(ResourceType<ECS_TYPE, T> resourceType) intprotected <Event extends EcsEvent>
voidinternal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, EntityEventType<ECS_TYPE, Event> systemType, Ref<ECS_TYPE> ref, Event param) protected <Event extends EcsEvent>
voidinternal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, WorldEventType<ECS_TYPE, Event> systemType, Event param) protected <Event extends EcsEvent>
voidinternal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, Ref<ECS_TYPE> ref, Event param) protected <Event extends EcsEvent>
voidinternal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, Event param) <Event extends EcsEvent>
voidinvoke(EntityEventType<ECS_TYPE, Event> systemType, Ref<ECS_TYPE> ref, Event param) <Event extends EcsEvent>
voidinvoke(WorldEventType<ECS_TYPE, Event> systemType, Event param) <Event extends EcsEvent>
void<Event extends EcsEvent>
voidinvoke(Event param) booleanbooleanbooleanDeprecated.boolean(package private) voidonAdd(ComponentRegistry.Data<ECS_TYPE> data) voidpausedTick(float dt) putComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType, T component) private voidremoveArchetypeChunk(int archetypeIndex) removeComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) removeComponentIfExists(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) removeEntities(Ref<ECS_TYPE>[] refs, int start, int length, RemoveReason reason) removeEntities(Ref<ECS_TYPE>[] refArr, int refStart, Holder<ECS_TYPE>[] holders, int holderStart, int length, RemoveReason reason) removeEntities(Ref<ECS_TYPE>[] refs, Holder<ECS_TYPE>[] holders, RemoveReason reason) removeEntities(Ref<ECS_TYPE>[] refs, RemoveReason reason) removeEntity(Ref<ECS_TYPE> ref, Holder<ECS_TYPE> holder, RemoveReason reason) removeEntity(Ref<ECS_TYPE> ref, Holder<ECS_TYPE> holder, RemoveReason reason, Throwable proxyReason) removeEntity(Ref<ECS_TYPE> ref, RemoveReason reason) replaceComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType, T component) replaceResource(ResourceType<ECS_TYPE, T> resourceType, T resource) private CompletableFuture<Void> protected voidsetEntityChunkIndex(Ref<ECS_TYPE> ref, int newEntityChunkIndex) voidshutdown()(package private) void(package private) voidstoreCommandBuffer(CommandBuffer<ECS_TYPE> commandBuffer) (package private) CommandBuffer<ECS_TYPE> voidtick(float dt) voidtick(ArchetypeTickingSystem<ECS_TYPE> system, float dt, int systemIndex) private <Tickable extends TickableSystem<ECS_TYPE>>
voidtickInternal(float dt, SystemType<ECS_TYPE, Tickable> tickingSystemType) toString()tryRemoveComponent(Ref<ECS_TYPE> ref, ComponentType<ECS_TYPE, T> componentType) private void(package private) voidupdateData(ComponentRegistry.Data<ECS_TYPE> oldData, ComponentRegistry.Data<ECS_TYPE> data) private voidupdateData(ComponentRegistry.Data<ECS_TYPE> oldData, ComponentRegistry.Data<ECS_TYPE> newData, DataChange dataChange) private voidupdateData0(ComponentRegistry.Data<ECS_TYPE> oldData, ComponentRegistry.Data<ECS_TYPE> newData, DataChange dataChange)
-
Field Details
-
EMPTY_ARRAY
-
METRICS_REGISTRY
-
registry
-
externalData
-
resourceStorage
-
commandBuffers
-
thread
-
parallelTask
-
forEachTask
-
fetchTask
-
processing
-
shutdown
private boolean shutdown -
storeIndex
int storeIndex -
entitiesSize
private int entitiesSize -
refs
-
entityToArchetypeChunk
@Nonnull private int[] entityToArchetypeChunk -
entityChunkIndex
@Nonnull private int[] entityChunkIndex -
systemIndexToArchetypeChunkIndexes
-
archetypeChunkIndexesToSystemIndex
-
archetypeToIndexMap
-
archetypeSize
private int archetypeSize -
archetypeChunkReuse
-
archetypeChunks
-
resources
-
systemMetrics
-
disableProcessingAssert
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
Store
Store(@Nonnull ComponentRegistry<ECS_TYPE> registry, int storeIndex, @Nonnull ECS_TYPE externalData, @Nonnull IResourceStorage resourceStorage)
-
-
Method Details
-
takeCommandBuffer
-
storeCommandBuffer
-
getStoreIndex
public int getStoreIndex() -
getRegistry
-
getExternalData
- Specified by:
getExternalDatain interfaceComponentAccessor<ECS_TYPE>
-
getResourceStorage
-
getParallelTask
-
getFetchTask
-
getSystemMetrics
-
isShutdown
public boolean isShutdown() -
onAdd
-
shutdown
public void shutdown() -
shutdown0
-
saveAllResources
-
saveAllResources0
@Nonnull private CompletableFuture<Void> saveAllResources0(@Nonnull ComponentRegistry.Data<ECS_TYPE> data) -
getEntityCount
public int getEntityCount() -
getEntityCountFor
-
getEntityCountFor
public int getEntityCountFor(int systemIndex) -
getArchetypeChunkCount
public int getArchetypeChunkCount() -
collectArchetypeChunkData
-
getArchetypeChunkCountFor
public int getArchetypeChunkCountFor(int systemIndex) -
setEntityChunkIndex
-
addEntity
-
addEntity
@Nullable public Ref<ECS_TYPE> addEntity(@Nonnull Holder<ECS_TYPE> holder, @Nonnull AddReason reason) - Specified by:
addEntityin interfaceComponentAccessor<ECS_TYPE>
-
addEntity
-
addEntities
@Nonnull public Ref<ECS_TYPE>[] addEntities(@Nonnull Holder<ECS_TYPE>[] holders, @Nonnull AddReason reason) - Specified by:
addEntitiesin interfaceComponentAccessor<ECS_TYPE>
-
addEntities
-
addEntities
-
addEntities
-
copyEntity
-
copyEntity
-
copySerializableEntity
-
copySerializableEntity
-
getArchetype
- Specified by:
getArchetypein interfaceComponentAccessor<ECS_TYPE>
-
__internal_getArchetype
-
removeEntity
@Nonnull public Holder<ECS_TYPE> removeEntity(@Nonnull Ref<ECS_TYPE> ref, @Nonnull RemoveReason reason) -
removeEntity
@Nonnull public Holder<ECS_TYPE> removeEntity(@Nonnull Ref<ECS_TYPE> ref, @Nonnull Holder<ECS_TYPE> holder, @Nonnull RemoveReason reason) - Specified by:
removeEntityin interfaceComponentAccessor<ECS_TYPE>
-
removeEntity
-
removeEntities
@Nonnull public Holder<ECS_TYPE>[] removeEntities(@Nonnull Ref<ECS_TYPE>[] refs, @Nonnull RemoveReason reason) -
removeEntities
@Nonnull public Holder<ECS_TYPE>[] removeEntities(@Nonnull Ref<ECS_TYPE>[] refs, int start, int length, @Nonnull RemoveReason reason) -
removeEntities
-
removeEntities
-
ensureComponent
-
ensureAndGetComponent
@Nonnull public <T extends Component<ECS_TYPE>> T ensureAndGetComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType) - Specified by:
ensureAndGetComponentin interfaceComponentAccessor<ECS_TYPE>
-
addComponent
@Nonnull public <T extends Component<ECS_TYPE>> T addComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType) - Specified by:
addComponentin interfaceComponentAccessor<ECS_TYPE>
-
addComponent
public <T extends Component<ECS_TYPE>> void addComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType, @Nonnull T component) - Specified by:
addComponentin interfaceComponentAccessor<ECS_TYPE>
-
replaceComponent
-
putComponent
public <T extends Component<ECS_TYPE>> void putComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType, @Nonnull T component) - Specified by:
putComponentin interfaceComponentAccessor<ECS_TYPE>
-
getComponent
public <T extends Component<ECS_TYPE>> T getComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType) - Specified by:
getComponentin interfaceComponentAccessor<ECS_TYPE>
-
__internal_getComponent
-
removeComponent
public <T extends Component<ECS_TYPE>> void removeComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType) - Specified by:
removeComponentin interfaceComponentAccessor<ECS_TYPE>
-
tryRemoveComponent
public <T extends Component<ECS_TYPE>> void tryRemoveComponent(@Nonnull Ref<ECS_TYPE> ref, @Nonnull ComponentType<ECS_TYPE, T> componentType) - Specified by:
tryRemoveComponentin interfaceComponentAccessor<ECS_TYPE>
-
removeComponentIfExists
-
replaceResource
public <T extends Resource<ECS_TYPE>> void replaceResource(@Nonnull ResourceType<ECS_TYPE, T> resourceType, @Nonnull T resource) -
getResource
@Nonnull public <T extends Resource<ECS_TYPE>> T getResource(@Nonnull ResourceType<ECS_TYPE, T> resourceType) - Specified by:
getResourcein interfaceComponentAccessor<ECS_TYPE>
-
__internal_getResource
@Nonnull protected <T extends Resource<ECS_TYPE>> T __internal_getResource(@Nonnull ResourceType<ECS_TYPE, T> resourceType) -
forEachChunk
public void forEachChunk(@Nonnull BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) -
forEachChunk
public boolean forEachChunk(@Nonnull BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) -
forEachChunk
public void forEachChunk(Query<ECS_TYPE> query, @Nonnull BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) -
forEachChunk
public boolean forEachChunk(Query<ECS_TYPE> query, @Nonnull BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) -
forEachChunk
public void forEachChunk(int systemIndex, @Nonnull BiConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) -
forEachChunk
public boolean forEachChunk(int systemIndex, @Nonnull BiPredicate<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> predicate) -
forEachEntityParallel
public void forEachEntityParallel(IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) -
forEachEntityParallel
public void forEachEntityParallel(Query<ECS_TYPE> query, IntBiObjectConsumer<ArchetypeChunk<ECS_TYPE>, CommandBuffer<ECS_TYPE>> consumer) -
fetch
public <T extends ArchetypeDataSystem<ECS_TYPE,Q, void fetchR>, Q, R> (@Nonnull SystemType<ECS_TYPE, T> systemType, Q query, @Nonnull List<R> results) -
fetch
public <T extends EntityDataSystem<ECS_TYPE,Q, void fetchR>, Q, R> (@Nonnull Collection<Ref<ECS_TYPE>> refs, @Nonnull SystemType<ECS_TYPE, T> systemType, Q query, @Nonnull List<R> results) -
invoke
- Specified by:
invokein interfaceComponentAccessor<ECS_TYPE>
-
invoke
public <Event extends EcsEvent> void invoke(@Nonnull EntityEventType<ECS_TYPE, Event> systemType, @Nonnull Ref<ECS_TYPE> ref, @Nonnull Event param) - Specified by:
invokein interfaceComponentAccessor<ECS_TYPE>
-
invoke
- Specified by:
invokein interfaceComponentAccessor<ECS_TYPE>
-
invoke
public <Event extends EcsEvent> void invoke(@Nonnull WorldEventType<ECS_TYPE, Event> systemType, @Nonnull Event param) - Specified by:
invokein interfaceComponentAccessor<ECS_TYPE>
-
internal_invoke
protected <Event extends EcsEvent> void internal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, Ref<ECS_TYPE> ref, Event param) -
internal_invoke
protected <Event extends EcsEvent> void internal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, @Nonnull EntityEventType<ECS_TYPE, Event> systemType, Ref<ECS_TYPE> ref, Event param) -
internal_invoke
protected <Event extends EcsEvent> void internal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, Event param) -
internal_invoke
protected <Event extends EcsEvent> void internal_invoke(CommandBuffer<ECS_TYPE> sourceCommandBuffer, @Nonnull WorldEventType<ECS_TYPE, Event> systemType, Event param) -
tick
public void tick(float dt) -
pausedTick
public void pausedTick(float dt) -
tickInternal
private <Tickable extends TickableSystem<ECS_TYPE>> void tickInternal(float dt, SystemType<ECS_TYPE, Tickable> tickingSystemType) -
tick
-
updateData
void updateData(@Nonnull ComponentRegistry.Data<ECS_TYPE> oldData, @Nonnull ComponentRegistry.Data<ECS_TYPE> data) -
updateData
private void updateData(@Nonnull ComponentRegistry.Data<ECS_TYPE> oldData, @Nonnull ComponentRegistry.Data<ECS_TYPE> newData, DataChange dataChange) -
updateData0
private void updateData0(@Nonnull ComponentRegistry.Data<ECS_TYPE> oldData, @Nonnull ComponentRegistry.Data<ECS_TYPE> newData, DataChange dataChange) -
updateArchetypeIndexes
-
assertWriteProcessing
public void assertWriteProcessing() -
isProcessing
Deprecated. -
assertThread
public void assertThread() -
isInThread
public boolean isInThread() -
isAliveInDifferentThread
public boolean isAliveInDifferentThread() -
toString
-
datachunk_addComponent
private <T extends Component<ECS_TYPE>> void datachunk_addComponent(@Nonnull Ref<ECS_TYPE> ref, int fromArchetypeIndex, @Nonnull ComponentType<ECS_TYPE, T> componentType, @Nonnull T component, @Nonnull CommandBuffer<ECS_TYPE> commandBuffer) -
findOrCreateArchetypeChunk
-
removeArchetypeChunk
private void removeArchetypeChunk(int archetypeIndex)
-