Interface IIngredientComponentStorageObservable<T,M>

Type Parameters:
T - The instance type.
M - The matching condition parameter, may be Void. Instances MUST properly implement the equals method.
All Known Subinterfaces:
IEnergyNetwork, IPositionedAddonsNetworkIngredients<T,M>
All Known Implementing Classes:
EnergyNetwork, PositionedAddonsNetworkIngredients

public interface IIngredientComponentStorageObservable<T,M>
An observable ingredient component storage.
  • Method Details

    • getComponent

      org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> getComponent()
      Returns:
      The ingredient component type this storage applies to.
    • addObserver

      Add an observer for listing to index change events.
      Parameters:
      observer - An index change observer.
    • removeObserver

      Remove the given index change observer. This will silently fail if the given observer was not registered.
      Parameters:
      observer - An index change observer.
    • scheduleObservation

      void scheduleObservation()
      Indicate that this network should observe starting somewhere in the future. This should be called when observer diffs are needed, but are not urgent. This is a more efficient variant of scheduleObservationForced(int, PartPos). This should be called each time that observations are needed, as this observable will reset the internal flag after each observation.
    • scheduleObservationForced

      void scheduleObservationForced(int channel, PartPos pos)
      Indicate that this network should observe starting in the next tick. This is a stricter variant of scheduleObservation(), and can only be done for a single position and channel. This should be called when observer diffs are needed in the next tick for the given position.
      Parameters:
      channel - The channel to force an observation in.
      pos - The position to force an observation for.
    • shouldObserve

      boolean shouldObserve()
      Returns:
      If an observation should happen.
    • isObservationForcedPending

      boolean isObservationForcedPending(int channel)
      Parameters:
      channel - The channel to check for a forced observation in.
      Returns:
      If the given channel contains a forced observation scheduling that has not been processed yet.
    • runObserverSync

      void runObserverSync()
      Manually run observer synchronously (even if async is allowed), if it should observe.
    • getChannelIndex

      IIngredientPositionsIndex<T,M> getChannelIndex(int channel)
      Get the last indexed storage at the given channel.
      Parameters:
      channel - A channel id.
      Returns:
      A channel index.