Class ProgWidgetConditionBase

java.lang.Object
me.desht.pneumaticcraft.common.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetConditionBase
All Implemented Interfaces:
IProgWidgetBase, IJump, IProgWidget
Direct Known Subclasses:
ProgWidgetCoordinateCondition, ProgWidgetDroneCondition, ProgWidgetItemCondition

public abstract class ProgWidgetConditionBase extends ProgWidget implements IJump
Base class for non-world conditions (drone/item/coordinate)
  • Method Details

    • hasStepInput

      public boolean hasStepInput()
      Description copied from interface: IProgWidget
      Can this widget connect to a widget above?
      Specified by:
      hasStepInput in interface IProgWidget
      Returns:
      true if it can, false otherwise
    • returnType

      public ProgWidgetType<?> returnType()
      Description copied from interface: IProgWidget
      For parameter widgets that are added onto the left or right of another widget, get the type of the widget being connected to.
      Specified by:
      returnType in interface IProgWidget
      Returns:
      the widget being connected to, or null if this widget isn't a parameter widget.
    • getDifficulty

      public IProgWidget.WidgetDifficulty getDifficulty()
      Specified by:
      getDifficulty in interface IProgWidget
    • addErrors

      public void addErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets)
      Specified by:
      addErrors in interface IProgWidget
      Overrides:
      addErrors in class ProgWidget
    • getPossibleJumpLocations

      public List<String> getPossibleJumpLocations()
      Specified by:
      getPossibleJumpLocations in interface IJump
    • getOutputWidget

      public IProgWidget getOutputWidget(IDroneBase drone, List<IProgWidget> allWidgets)
      Description copied from interface: IProgWidget
      Get the next widget in the program, which may or may not be the widget attached to the bottom of this one. This method variant is called when running in a live program, and has access to the drone context and a view of the full program so it can deal with special conditions like jumps etc.
      Specified by:
      getOutputWidget in interface IProgWidget
      Overrides:
      getOutputWidget in class ProgWidget
      Parameters:
      drone - the drone
      allWidgets - a list of widgets
      Returns:
      the next widget to run
    • evaluate

      public abstract boolean evaluate(IDroneBase drone, IProgWidget widget)
    • getColor

      public net.minecraft.world.item.DyeColor getColor()
      Specified by:
      getColor in interface IProgWidget