Class PositionedAddonsNetwork
java.lang.Object
org.cyclops.integrateddynamics.core.network.PositionedAddonsNetwork
- All Implemented Interfaces:
IPositionedAddonsNetwork
- Direct Known Subclasses:
PositionedAddonsNetworkIngredients
A network that can hold prioritized positions.
-
Field Summary
Fields inherited from interface org.cyclops.integrateddynamics.api.network.IPositionedAddonsNetwork
DEFAULT_CHANNEL, WILDCARD_CHANNEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPosition(PartPos pos, int priority, int channel) Add the given position.voiddisablePosition(PartPos pos) Disable a position.voidenablePosition(PartPos pos) Enable a position.int[]intGet the channel this position is present in.getPrioritizedPositions(int channel) booleanprotected voidbooleanCheck if the given position is disabled.protected voidonPositionAdded(int channel, PrioritizedPartPos pos) protected voidonPositionRemoved(int channel, PrioritizedPartPos pos) voidremovePosition(PartPos pos) Remove the given position.voidsetPartPosIteratorHandler(IPartPosIteratorHandler iteratorHandler) Set a part positions iterator handler for this network.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.network.IPositionedAddonsNetwork
getPositions, getPositions
-
Constructor Details
-
PositionedAddonsNetwork
public PositionedAddonsNetwork()
-
-
Method Details
-
getChannels
public int[] getChannels()- Specified by:
getChannelsin interfaceIPositionedAddonsNetwork- Returns:
- The channels that have at least one active position.
-
hasPositions
public boolean hasPositions()- Specified by:
hasPositionsin interfaceIPositionedAddonsNetwork- Returns:
- If any positioned addons are present in this network.
-
getPrioritizedPositions
- Specified by:
getPrioritizedPositionsin interfaceIPositionedAddonsNetwork- Parameters:
channel- The channel id.- Returns:
- The stored positions, sorted by priority.
-
getPrioritizedPositions
- Specified by:
getPrioritizedPositionsin interfaceIPositionedAddonsNetwork- Returns:
- All stored positions, order is undefined.
-
getPositionChannel
Description copied from interface:IPositionedAddonsNetworkGet the channel this position is present in. -1 if it is not present in any channel.- Specified by:
getPositionChannelin interfaceIPositionedAddonsNetwork- Parameters:
pos- A position.- Returns:
- A channel.
-
invalidateIterators
protected void invalidateIterators() -
setPartPosIteratorHandler
Description copied from interface:IPositionedAddonsNetworkSet a part positions iterator handler for this network.- Specified by:
setPartPosIteratorHandlerin interfaceIPositionedAddonsNetwork- Parameters:
iteratorHandler- An iterator handler or null if it should be reset.
-
getPartPosIteratorHandler
- Specified by:
getPartPosIteratorHandlerin interfaceIPositionedAddonsNetwork- Returns:
- The part positions iterator handler for this network.
-
addPosition
Description copied from interface:IPositionedAddonsNetworkAdd the given position.- Specified by:
addPositionin interfaceIPositionedAddonsNetwork- Parameters:
pos- The position.priority- The priority.channel- The channel id.- Returns:
- If the position was added, otherwise it was already present.
-
onPositionAdded
-
removePosition
Description copied from interface:IPositionedAddonsNetworkRemove the given position.- Specified by:
removePositionin interfaceIPositionedAddonsNetwork- Parameters:
pos- The position.
-
onPositionRemoved
-
isPositionDisabled
Description copied from interface:IPositionedAddonsNetworkCheck if the given position is disabled.- Specified by:
isPositionDisabledin interfaceIPositionedAddonsNetwork- Parameters:
pos- The position.- Returns:
- If it is disabled.
-
disablePosition
Description copied from interface:IPositionedAddonsNetworkDisable a position.- Specified by:
disablePositionin interfaceIPositionedAddonsNetwork- Parameters:
pos- The position.
-
enablePosition
Description copied from interface:IPositionedAddonsNetworkEnable a position.- Specified by:
enablePositionin interfaceIPositionedAddonsNetwork- Parameters:
pos- The position.
-