Interface IPartNetwork
- All Superinterfaces:
ILazyExpressionValueCache
- All Known Implementing Classes:
PartNetwork
A network capability that can hold parts.
Note that this network only contains references to the relevant data, it does not contain the actual information.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add the given part state to the network.boolean
addProxy
(int proxyId, org.cyclops.cyclopscore.datastructure.DimPos dimPos) Add the given proxy to the network.boolean
addVariableContainer
(org.cyclops.cyclopscore.datastructure.DimPos dimPos) Add the position of a variable container.getPartState
(int partId) Get the part state by id from this network.getPartType
(int partId) Get the part by id from this network.getPartVariable
(int partId, IAspectRead<V, ?> aspect) Get the current variable from the aspect of the given part id.org.cyclops.cyclopscore.datastructure.DimPos
getProxy
(int proxyId) Check if this network contains the given part id.getVariableFacade
(int variableId) Get the variable facade with given variable id.boolean
hasPart
(int partId) Check if this network contains the given part id.<V extends IValue>
booleanhasPartVariable
(int partId, IAspectRead<V, ?> aspect) Check if a variable can be found for a given part and aspect.boolean
hasVariableFacade
(int variableId) Check if this network has access to the variable facade with given variable id.void
Tell the network to recheck all parts next update round.void
removePart
(int partId) Remove the part state by id from this network.void
removeProxy
(int proxyId) Remove the proxy by id from this network.void
removeVariableContainer
(org.cyclops.cyclopscore.datastructure.DimPos dimPos) Remove the position of a variable container.Methods inherited from interface org.cyclops.integrateddynamics.api.evaluate.expression.ILazyExpressionValueCache
getValue, hasValue, removeValue, setValue
-
Method Details
-
addPart
Add the given part state to the network.- Parameters:
partId
- The id of the part.partPos
- The part position to add.- Returns:
- If the addition was successful.
-
getPartState
Get the part state by id from this network.- Parameters:
partId
- The part state id.- Returns:
- The corresponding part state or null.
-
getPartType
Get the part by id from this network.- Parameters:
partId
- The part state id.- Returns:
- The corresponding part or null.
-
removePart
void removePart(int partId) Remove the part state by id from this network.- Parameters:
partId
- The part state id.
-
hasPart
boolean hasPart(int partId) Check if this network contains the given part id.- Parameters:
partId
- The part state id.- Returns:
- If this part is present in this network.
-
hasPartVariable
Check if a variable can be found for a given part and aspect.- Type Parameters:
V
- The value.- Parameters:
partId
- The part state id.aspect
- The aspect from the given part.- Returns:
- True if such a variable can be found. False if the given part is not present in the network or if the given aspect is not present at that part.
-
getPartVariable
Get the current variable from the aspect of the given part id. This method can call a NPE or cast exception when the given part does not exists, so make sure to check this before.- Type Parameters:
V
- The value.- Parameters:
partId
- The part state id.aspect
- The aspect from the given part.- Returns:
- The variable.
-
hasVariableFacade
boolean hasVariableFacade(int variableId) Check if this network has access to the variable facade with given variable id.- Parameters:
variableId
- The variable id.- Returns:
- If this network has access to it.
-
getVariableFacade
Get the variable facade with given variable id.- Parameters:
variableId
- The variable id.- Returns:
- The variable facade.
-
addVariableContainer
boolean addVariableContainer(org.cyclops.cyclopscore.datastructure.DimPos dimPos) Add the position of a variable container.- Parameters:
dimPos
- The variable container position.- Returns:
- If the container did not exist in the network already.
-
removeVariableContainer
void removeVariableContainer(org.cyclops.cyclopscore.datastructure.DimPos dimPos) Remove the position of a variable container.- Parameters:
dimPos
- The variable container position.
-
addProxy
boolean addProxy(int proxyId, org.cyclops.cyclopscore.datastructure.DimPos dimPos) Add the given proxy to the network.- Parameters:
proxyId
- The id of the proxy.dimPos
- The proxy position.- Returns:
- If the addition was successful.
-
removeProxy
void removeProxy(int proxyId) Remove the proxy by id from this network.- Parameters:
proxyId
- The id of the proxy.
-
getProxy
org.cyclops.cyclopscore.datastructure.DimPos getProxy(int proxyId) Check if this network contains the given part id.- Parameters:
proxyId
- The id of the proxy.- Returns:
- The proxy position.
-
notifyPartsChanged
void notifyPartsChanged()Tell the network to recheck all parts next update round.
-