CommandBuffer

public class CommandBuffer

Defers entity operations until after the current tick. Use command buffers to safely modify entities from within system callbacks, avoiding concurrent modification issues.

java.lang.Object > CommandBuffer

Field Summary

trackedRef

private Ref trackedRef

Field trackedRef.

trackedRefRemoved

private boolean trackedRefRemoved

Field trackedRefRemoved.

parentBuffer

private CommandBuffer parentBuffer

Field parentBuffer.

thread

private Thread thread

Field thread.

refs

final Ref[] refs

Field refs.

ref

final Ref ref

Field ref.

source

final Throwable source

Field source.

component

final T component

Field component.

newComponent

final T newComponent

Field newComponent.

wasRemoved

final boolean wasRemoved

Field wasRemoved.

forkedBuffer

final CommandBuffer forkedBuffer

Field forkedBuffer.

Method Detail

CommandBuffer

public protected CommandBuffer (@Nonnull final Store store)

Method CommandBuffer.

Parameters:
@Nonnull final Store store

getStore

public Store getStore ()

Method getStore.

run

public void run (@Nonnull final Consumer> consumer)

Method run.

Parameters:
@Nonnull final Consumer> consumer

getComponent

public T getComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method getComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

getArchetype

public Archetype getArchetype (@Nonnull final Ref ref)

Method getArchetype.

Parameters:
@Nonnull final Ref ref

getResource

public T getResource (@Nonnull final ResourceType resourceType)

Method getResource.

Parameters:
@Nonnull final ResourceType resourceType

getExternalData

public ECS_TYPE getExternalData ()

Method getExternalData.

addEntities

public Ref[] addEntities (@Nonnull final Holder[] holders, @Nonnull final AddReason reason)

Method addEntities.

Parameters:
@Nonnull final Holder[] holders
@Nonnull final AddReason reason

addEntity

public Ref addEntity (@Nonnull final Holder holder, @Nonnull final AddReason reason)

Method addEntity.

Parameters:
@Nonnull final Holder holder
@Nonnull final AddReason reason

copyEntity

public Holder copyEntity (@Nonnull final Ref ref, @Nonnull final Holder target)

Method copyEntity.

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

tryRemoveEntity

public void tryRemoveEntity (@Nonnull final Ref ref, @Nonnull final RemoveReason reason)

Method tryRemoveEntity.

Parameters:
@Nonnull final Ref ref
@Nonnull final RemoveReason reason

removeEntity

public void removeEntity (@Nonnull final Ref ref, @Nonnull final RemoveReason reason)

Method removeEntity.

Parameters:
@Nonnull final Ref ref
@Nonnull final RemoveReason reason

ensureComponent

public void ensureComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method ensureComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

ensureAndGetComponent

public T ensureAndGetComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method ensureAndGetComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

addComponent

public T addComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method addComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

replaceComponent

public void replaceComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType, @Nonnull final T component)

Method replaceComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType
@Nonnull final T component

removeComponent

public void removeComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method removeComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

tryRemoveComponent

public void tryRemoveComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType)

Method tryRemoveComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType

putComponent

public void putComponent (@Nonnull final Ref ref, @Nonnull final ComponentType componentType, @Nonnull final T component)

Method putComponent.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentType componentType
@Nonnull final T component

invoke

public void invoke (@Nonnull final Ref ref, @Nonnull final Event param)

Method invoke.

Parameters:
@Nonnull final Ref ref
@Nonnull final Event param

track

public void track (@Nonnull final Ref ref)

Method track.

Parameters:
@Nonnull final Ref ref

testRemovedTracked

private void testRemovedTracked (@Nonnull final Ref ref)

Method testRemovedTracked.

Parameters:
@Nonnull final Ref ref

consumeWasTrackedRefRemoved

public boolean consumeWasTrackedRefRemoved ()

Method consumeWasTrackedRefRemoved.

consume

public void consume ()

Method consume.

fork

public CommandBuffer fork ()

Method fork.

mergeParallel

public void mergeParallel (@Nonnull final CommandBuffer commandBuffer)

Method mergeParallel.

Parameters:
@Nonnull final CommandBuffer commandBuffer

setThread

public boolean setThread ()

Method setThread.

AssertionError

public new AssertionError ((Object)

Method AssertionError.

Parameters:
(Object (Object

validateEmpty

public void validateEmpty ()

Method validateEmpty.

See Also: