Interface IPartTypeActiveVariable<P extends IPartTypeActiveVariable<P,S>,S extends IPartState<P>>

All Superinterfaces:
INetworkEventListener<IPartNetworkElement<P,S>>, IPartType<P,S>
All Known Subinterfaces:
IPartTypeWriter<P,S>
All Known Implementing Classes:
PartTypeAudioWriter, PartTypeEffectWriter, PartTypeEntityWriter, PartTypeInventoryWriter, PartTypeMachineWriter, PartTypePanelDisplay, PartTypePanelLightDynamic, PartTypePanelVariableDriven, PartTypeRedstoneWriter, PartTypeWriteBase

public interface IPartTypeActiveVariable<P extends IPartTypeActiveVariable<P,S>,S extends IPartState<P>> extends IPartType<P,S>
A part type that can have an active variable.
  • Method Details

    • hasActiveVariable

      boolean hasActiveVariable(IPartNetwork network, PartTarget target, S partState)
      Parameters:
      network - The network this part belongs to.
      target - The target block.
      partState - The state of this part.
      Returns:
      If there is an active variable present.
    • getActiveVariable

      <V extends IValue> IVariable<V> getActiveVariable(INetwork network, IPartNetwork partNetwork, PartTarget target, S partState)
      Get the variable that is currently active for this part, the value in this variable will be used to write something.
      Type Parameters:
      V - The value type.
      Parameters:
      network - The network this part belongs to.
      partNetwork - The part network this part belongs to.
      target - The target block.
      partState - The state of this part.
      Returns:
      The variable reference to some other value that needs to be written by this part.