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 Details

    • DEFAULT_CHANNEL

      static final int DEFAULT_CHANNEL
      The 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_CHANNEL
      Specifying 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

      Collection<PrioritizedPartPos> getPrioritizedPositions(int channel)
      Parameters:
      channel - The channel id.
      Returns:
      The stored positions, sorted by priority.
    • getPositionChannel

      int getPositionChannel(PartPos pos)
      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

      default Collection<PartPos> getPositions(int channel)
      Parameters:
      channel - The channel id.
      Returns:
      The stored positions, sorted by priority.
    • getPrioritizedPositions

      Collection<PrioritizedPartPos> getPrioritizedPositions()
      Returns:
      All stored positions, order is undefined.
    • getPositions

      default Iterable<PartPos> getPositions()
      Returns:
      All stored positions, order is undefined.
    • getPartPosIteratorHandler

      @Nullable IPartPosIteratorHandler getPartPosIteratorHandler()
      Returns:
      The part positions iterator handler for this network.
    • setPartPosIteratorHandler

      void setPartPosIteratorHandler(@Nullable IPartPosIteratorHandler iteratorHandler)
      Set a part positions iterator handler for this network.
      Parameters:
      iteratorHandler - An iterator handler or null if it should be reset.
    • addPosition

      boolean addPosition(PartPos pos, int priority, int channel)
      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

      void removePosition(PartPos pos)
      Remove the given position.
      Parameters:
      pos - The position.
    • isPositionDisabled

      boolean isPositionDisabled(PartPos pos)
      Check if the given position is disabled.
      Parameters:
      pos - The position.
      Returns:
      If it is disabled.
    • disablePosition

      void disablePosition(PartPos pos)
      Disable a position.
      Parameters:
      pos - The position.
    • enablePosition

      void enablePosition(PartPos pos)
      Enable a position.
      Parameters:
      pos - The position.