Class BaseInstancer<I extends Instance>
java.lang.Object
dev.engine_room.flywheel.backend.engine.AbstractInstancer<I>
dev.engine_room.flywheel.backend.engine.BaseInstancer<I>
- All Implemented Interfaces:
Instancer<I>,InstanceHandleImpl.State<I>
- Direct Known Subclasses:
InstancedInstancer
public abstract class BaseInstancer<I extends Instance>
extends AbstractInstancer<I>
implements InstanceHandleImpl.State<I>
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
AbstractInstancer.Recreate<I extends Instance> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicBitSetprotected final AtomicBitSetprotected final ArrayList<InstanceHandleImpl<I>> protected final ObjectFields inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
environment, recreate, type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseInstancer(InstancerKey<I> key, AbstractInstancer.Recreate<I> recreate) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all instances without freeing resources.intvoidnotifyDirty(int index) voidnotifyRemoval(int index) revealInstance(InstanceHandleImpl<I> handle, I instance) setChanged(int index) setDeleted(int index) protected voidsetIndexChanged(int index) setVisible(InstanceHandleImpl<I> handle, int index, boolean visible) voidstealInstance(I instance) Steal an instance from another instancer.Methods inherited from class dev.engine_room.flywheel.backend.engine.AbstractInstancer
delete, parallelUpdate, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.engine_room.flywheel.api.instance.Instancer
createInstances
-
Field Details
-
lock
-
instances
-
handles
-
changed
-
deleted
-
-
Constructor Details
-
BaseInstancer
-
-
Method Details
-
setChanged
- Specified by:
setChangedin interfaceInstanceHandleImpl.State<I extends Instance>
-
setDeleted
- Specified by:
setDeletedin interfaceInstanceHandleImpl.State<I extends Instance>
-
setVisible
public InstanceHandleImpl.State<I> setVisible(InstanceHandleImpl<I> handle, int index, boolean visible) - Specified by:
setVisiblein interfaceInstanceHandleImpl.State<I extends Instance>
-
createInstance
- Specified by:
createInstancein interfaceInstancer<I extends Instance>- Returns:
- a handle to a new copy of this model.
-
revealInstance
- Specified by:
revealInstancein classAbstractInstancer<I extends Instance>
-
stealInstance
Description copied from interface:InstancerSteal an instance from another instancer.
This has the effect of swapping the instance's model in-place.
If the given instance is already owned by this instancer, this method does nothing.
If the given instance isnull, this method does nothing.
If the given instance was created by a different backend, the behavior of this method is undefined.- Specified by:
stealInstancein interfaceInstancer<I extends Instance>- Parameters:
instance- The instance to steal.
-
instanceCount
public int instanceCount()- Specified by:
instanceCountin classAbstractInstancer<I extends Instance>
-
notifyDirty
public void notifyDirty(int index) -
setIndexChanged
protected void setIndexChanged(int index) -
notifyRemoval
public void notifyRemoval(int index) -
clear
public void clear()Clear all instances without freeing resources.- Specified by:
clearin classAbstractInstancer<I extends Instance>
-