ArchetypeChunk

public class ArchetypeChunk

Class ArchetypeChunk. Provides archetypechunk functionality for the Hytale server.

java.lang.Object > ArchetypeChunk

Field Summary

entitiesSize

protected int entitiesSize

Field entitiesSize.

refs

protected Ref[] refs

Field refs.

components

protected Component[][] components

Field components.

entityIndex

final int entityIndex

Field entityIndex.

oldLength

final int oldLength

Field oldLength.

newLength

final int newLength

Field newLength.

componentTypeIndex

final int componentTypeIndex

Field componentTypeIndex.

entityComponents

final Component[] entityComponents

Field entityComponents.

component

final Component component

Field component.

serializableArchetype

final Archetype serializableArchetype

Field serializableArchetype.

lastIndex

final int lastIndex

Field lastIndex.

ref

final Ref ref

Field ref.

newEntityIndex

final int newEntityIndex

Field newEntityIndex.

newSize

final int newSize

Field newSize.

componentArr

final Component[] componentArr

Field componentArr.

Method Detail

emptyArray

static ArchetypeChunk[] emptyArray ()

Method emptyArray.

ArchetypeChunk

public public ArchetypeChunk (@Nonnull final Store store, @Nonnull final Archetype archetype)

Method ArchetypeChunk.

Parameters:
@Nonnull final Store store
@Nonnull final Archetype archetype

getArchetype

public Archetype getArchetype ()

Method getArchetype.

size

public int size ()

Method size.

getReferenceTo

public Ref getReferenceTo (final int index)

Method getReferenceTo.

Parameters:
final int index

setComponent

public void setComponent (final int index, @Nonnull final ComponentType componentType, @Nonnull final T component)

Method setComponent.

Parameters:
final int index
@Nonnull final ComponentType componentType
@Nonnull final T component

IllegalArgumentException

public new IllegalArgumentException ("Entity doesn't have component type " + String.valueOf(componentType)

Method IllegalArgumentException.

Parameters:
"Entity doesn't have component type " + String.valueOf(componentType

getComponent

public T getComponent (final int index, @Nonnull final ComponentType componentType)

Method getComponent.

Parameters:
final int index
@Nonnull final ComponentType componentType

addEntity

public int addEntity (@Nonnull final Ref ref, @Nonnull final Holder holder)

Method addEntity.

Parameters:
@Nonnull final Ref ref
@Nonnull final Holder holder

copyEntity

public Holder copyEntity (final int entityIndex, @Nonnull final Holder target)

Method copyEntity.

Parameters:
final int entityIndex
@Nonnull final Holder target

copySerializableEntity

public Holder copySerializableEntity (@Nonnull final ComponentRegistry.Data data, final int entityIndex, @Nonnull final Holder target)

Method copySerializableEntity.

Parameters:
@Nonnull final ComponentRegistry.Data data
final int entityIndex
@Nonnull final Holder target

removeEntity

public Holder removeEntity (final int entityIndex, @Nonnull final Holder target)

Method removeEntity.

Parameters:
final int entityIndex
@Nonnull final Holder target

transferTo

public void transferTo (@Nonnull final Holder tempInternalEntityHolder, @Nonnull final ArchetypeChunk chunk, @Nonnull final Consumer> modification, @Nonnull final IntObjectConsumer> referenceConsumer)

Method transferTo.

Parameters:
@Nonnull final Holder tempInternalEntityHolder
@Nonnull final ArchetypeChunk chunk
@Nonnull final Consumer> modification
@Nonnull final IntObjectConsumer> referenceConsumer

transferSomeTo

public void transferSomeTo (@Nonnull final Holder tempInternalEntityHolder, @Nonnull final ArchetypeChunk chunk, @Nonnull final IntPredicate shouldTransfer, @Nonnull final Consumer> modification, @Nonnull final IntObjectConsumer> referenceConsumer)

Method transferSomeTo.

Parameters:
@Nonnull final Holder tempInternalEntityHolder
@Nonnull final ArchetypeChunk chunk
@Nonnull final IntPredicate shouldTransfer
@Nonnull final Consumer> modification
@Nonnull final IntObjectConsumer> referenceConsumer

fillEmptyIndex

protected void fillEmptyIndex (final int entityIndex, final int lastIndex)

Method fillEmptyIndex.

Parameters:
final int entityIndex
final int lastIndex

appendDump

public void appendDump (@Nonnull final String prefix, @Nonnull final StringBuilder sb)

Method appendDump.

Parameters:
@Nonnull final String prefix
@Nonnull final StringBuilder sb

toString

public String toString ()

Method toString.