Interface IPositionedAddonsNetwork
- All Known Subinterfaces:
IEnergyNetwork,IPositionedAddonsNetworkIngredients<T,M>
- All Known Implementing Classes:
EnergyNetwork,PositionedAddonsNetwork,PositionedAddonsNetworkIngredients
public interface IPositionedAddonsNetwork
A network that can hold prioritized positions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe channel that should be used for anything that doesn't allow the player to select a channel.static final intSpecifying this channel will allow interaction with all channels. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPosition(PartPos pos, int priority, int channel) Add the given position.static booleanchannelsMatch(int first, int second) Whether two parts on the given channels may interact.voiddisablePosition(PartPos pos) Disable a position.voidenablePosition(PartPos pos) Enable a position.int[]intGet the channel this position is present in.default Collection<PartPos> getPositions(int channel) getPrioritizedPositions(int channel) booleanbooleanCheck if the given position is disabled.voidremovePosition(PartPos pos) Remove the given position.voidsetPartPosIteratorHandler(IPartPosIteratorHandler iteratorHandler) Set a part positions iterator handler for this network.
-
Field Details
-
DEFAULT_CHANNEL
static final int DEFAULT_CHANNELThe channel that should be used for anything that doesn't allow the player to select a channel.- See Also:
-
WILDCARD_CHANNEL
static final int WILDCARD_CHANNELSpecifying this channel will allow interaction with all channels.- See Also:
-
-
Method Details
-
channelsMatch
static boolean channelsMatch(int first, int second) Whether two parts on the given channels may interact.- Parameters:
first- The id of the first channel.second- The id of the second channel.- Returns:
- If the two channels match.
-
getChannels
int[] getChannels()- Returns:
- The channels that have at least one active position.
-
hasPositions
boolean hasPositions()- Returns:
- If any positioned addons are present in this network.
-
getPrioritizedPositions
- Parameters:
channel- The channel id.- Returns:
- The stored positions, sorted by priority.
-
getPositionChannel
Get the channel this position is present in. -1 if it is not present in any channel.- Parameters:
pos- A position.- Returns:
- A channel.
-
getPositions
- Parameters:
channel- The channel id.- Returns:
- The stored positions, sorted by priority.
-
getPrioritizedPositions
Collection<PrioritizedPartPos> getPrioritizedPositions()- Returns:
- All stored positions, order is undefined.
-
getPositions
- Returns:
- All stored positions, order is undefined.
-
getPartPosIteratorHandler
- Returns:
- The part positions iterator handler for this network.
-
setPartPosIteratorHandler
Set a part positions iterator handler for this network.- Parameters:
iteratorHandler- An iterator handler or null if it should be reset.
-
addPosition
Add the given position.- Parameters:
pos- The position.priority- The priority.channel- The channel id.- Returns:
- If the position was added, otherwise it was already present.
-
removePosition
Remove the given position.- Parameters:
pos- The position.
-
isPositionDisabled
Check if the given position is disabled.- Parameters:
pos- The position.- Returns:
- If it is disabled.
-
disablePosition
Disable a position.- Parameters:
pos- The position.
-
enablePosition
Enable a position.- Parameters:
pos- The position.
-