Class PartStateReaderBase<P extends IPartTypeReader>
java.lang.Object
org.cyclops.integrateddynamics.core.part.PartStateBase<P>
org.cyclops.integrateddynamics.core.part.read.PartStateReaderBase<P>
- All Implemented Interfaces:
org.cyclops.cyclopscore.persist.IDirtyMarkListener
,IPartState<P>
,IPartStateReader<P>
public class PartStateReaderBase<P extends IPartTypeReader>
extends PartStateBase<P>
implements IPartStateReader<P>
A default implementation of the
IPartStateReader
.-
Field Summary
Fields inherited from interface org.cyclops.integrateddynamics.api.part.IPartState
GLOBALCOUNTER_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V extends IValue,
T extends IValueType<V>>
IAspectVariable<V>getVariable
(IAspectRead<V, T> aspect) Get the singleton variable for an aspect.void
Reset all cached aspect variables.void
setAspectProperties
(IAspect aspect, IAspectProperties properties) Set the properties for the given aspect.void
setVariable
(IAspect aspect, IAspectVariable variable) Get the singleton variable for an aspect.Methods inherited from class org.cyclops.integrateddynamics.core.part.PartStateBase
addVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getCapability, getChannel, getDefaultUpdateInterval, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, markDirty, markOffsetVariablesChanged, onDirty, readAspectProperties, readFromNBT, removeVolatileCapability, requiresOffsetUpdates, sendUpdate, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariables, writeAspectProperties, writeToNBT
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.integrateddynamics.api.part.IPartState
addVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getCapability, getChannel, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, loadInventoryNamed, markDirty, markOffsetVariablesChanged, readFromNBT, removeVolatileCapability, requiresOffsetUpdates, saveInventoryNamed, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariables, writeToNBT
-
Constructor Details
-
PartStateReaderBase
public PartStateReaderBase()
-
-
Method Details
-
getVariable
public <V extends IValue,T extends IValueType<V>> IAspectVariable<V> getVariable(IAspectRead<V, T> aspect) Description copied from interface:IPartStateReader
Get the singleton variable for an aspect. This only retrieves the previously stored state. Better to callIPartTypeReader.getVariable(PartTarget, IPartStateReader, IAspectRead)
.- Specified by:
getVariable
in interfaceIPartStateReader<P extends IPartTypeReader>
- Type Parameters:
V
- The value typeT
- The value type type- Parameters:
aspect
- The aspect from the part of this state.- Returns:
- The variable that exists only once for an aspect in this part state.
-
setVariable
Description copied from interface:IPartStateReader
Get the singleton variable for an aspect.- Specified by:
setVariable
in interfaceIPartStateReader<P extends IPartTypeReader>
- Parameters:
aspect
- The aspect from the part of this state.variable
- The variable that exists only once for an aspect in this part state.
-
resetVariables
public void resetVariables()Description copied from interface:IPartStateReader
Reset all cached aspect variables.- Specified by:
resetVariables
in interfaceIPartStateReader<P extends IPartTypeReader>
-
setAspectProperties
Description copied from interface:IPartState
Set the properties for the given aspect.- Specified by:
setAspectProperties
in interfaceIPartState<P extends IPartTypeReader>
- Overrides:
setAspectProperties
in classPartStateBase<P extends IPartTypeReader>
- Parameters:
aspect
- The aspect to get the properties from.properties
- The properties, this can be null if still the default.
-