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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addPosition
(PartPos pos, int priority, int channel) Add the given position.void
disablePosition
(PartPos pos) Disable a position.void
enablePosition
(PartPos pos) Enable a position.int[]
int
Get the channel this position is present in.getPrioritizedPositions
(int channel) boolean
protected void
boolean
Check if the given position is disabled.protected void
onPositionAdded
(int channel, PrioritizedPartPos pos) protected void
onPositionRemoved
(int channel, PrioritizedPartPos pos) void
removePosition
(PartPos pos) Remove the given position.void
setPartPosIteratorHandler
(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, wait
Methods inherited from interface org.cyclops.integrateddynamics.api.network.IPositionedAddonsNetwork
getPositions, getPositions
-
Constructor Details
-
PositionedAddonsNetwork
public PositionedAddonsNetwork()
-
-
Method Details
-
getChannels
public int[] getChannels()- Specified by:
getChannels
in interfaceIPositionedAddonsNetwork
- Returns:
- The channels that have at least one active position.
-
hasPositions
public boolean hasPositions()- Specified by:
hasPositions
in interfaceIPositionedAddonsNetwork
- Returns:
- If any positioned addons are present in this network.
-
getPrioritizedPositions
- Specified by:
getPrioritizedPositions
in interfaceIPositionedAddonsNetwork
- Parameters:
channel
- The channel id.- Returns:
- The stored positions, sorted by priority.
-
getPrioritizedPositions
- Specified by:
getPrioritizedPositions
in interfaceIPositionedAddonsNetwork
- Returns:
- All stored positions, order is undefined.
-
getPositionChannel
Description copied from interface:IPositionedAddonsNetwork
Get the channel this position is present in. -1 if it is not present in any channel.- Specified by:
getPositionChannel
in interfaceIPositionedAddonsNetwork
- Parameters:
pos
- A position.- Returns:
- A channel.
-
invalidateIterators
protected void invalidateIterators() -
setPartPosIteratorHandler
Description copied from interface:IPositionedAddonsNetwork
Set a part positions iterator handler for this network.- Specified by:
setPartPosIteratorHandler
in interfaceIPositionedAddonsNetwork
- Parameters:
iteratorHandler
- An iterator handler or null if it should be reset.
-
getPartPosIteratorHandler
- Specified by:
getPartPosIteratorHandler
in interfaceIPositionedAddonsNetwork
- Returns:
- The part positions iterator handler for this network.
-
addPosition
Description copied from interface:IPositionedAddonsNetwork
Add the given position.- Specified by:
addPosition
in 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:IPositionedAddonsNetwork
Remove the given position.- Specified by:
removePosition
in interfaceIPositionedAddonsNetwork
- Parameters:
pos
- The position.
-
onPositionRemoved
-
isPositionDisabled
Description copied from interface:IPositionedAddonsNetwork
Check if the given position is disabled.- Specified by:
isPositionDisabled
in interfaceIPositionedAddonsNetwork
- Parameters:
pos
- The position.- Returns:
- If it is disabled.
-
disablePosition
Description copied from interface:IPositionedAddonsNetwork
Disable a position.- Specified by:
disablePosition
in interfaceIPositionedAddonsNetwork
- Parameters:
pos
- The position.
-
enablePosition
Description copied from interface:IPositionedAddonsNetwork
Enable a position.- Specified by:
enablePosition
in interfaceIPositionedAddonsNetwork
- Parameters:
pos
- The position.
-