Class BinaryConditional

java.lang.Object
group24.escaperoom.entities.properties.conditionals.Conditional
group24.escaperoom.entities.properties.conditionals.BinaryConditional
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable, ItemPropertyValue
Direct Known Subclasses:
AndConditional, OrConditional, XORConditional

public abstract class BinaryConditional extends Conditional
A base class for conditonals with two children
  • Field Details

    • left

      protected Conditional left
      The left child of the conditon
  • Constructor Details

    • BinaryConditional

      public BinaryConditional()
  • Method Details

    • requiresPoll

      public boolean requiresPoll()
      Overrides:
      requiresPoll in class Conditional
      Returns:
      whether or not this Conditional requires polling
    • poll

      public boolean poll(GameContext ctx)
      Description copied from class: Conditional
      Given the game context, return whether or not this conditional needs to be polled. It must be valid to poll the conditional even after this function returns false
      Overrides:
      poll in class Conditional
      Parameters:
      ctx - the game context
      Returns:
      whether or not this conditional still needs to be polled
    • write

      public void write(com.badlogic.gdx.utils.Json json)
    • setChildren

      public void setChildren(Conditional... conds)
      Overrides:
      setChildren in class Conditional
      Parameters:
      conds - the Conditionals to set
    • read

      public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData)
    • getChildren

      public com.badlogic.gdx.utils.Array<Conditional> getChildren()
      Description copied from class: Conditional
      Returns an array of this conditional dependents, if they have any. The array will be the same length as Conditional.childCount()
      Overrides:
      getChildren in class Conditional
      Returns:
      an array of conditionals which this conditional depends on
    • childCount

      public Optional<Integer> childCount()
      Description copied from class: Conditional
      Whether or not to limit the number of children below this conditional By default assumes the condition can have no children
      Overrides:
      childCount in class Conditional
      Returns:
      Some(count) if this conditional has a limit to the number of children
    • getEditorConfiguration

      public Optional<com.badlogic.gdx.scenes.scene2d.Actor> getEditorConfiguration(LevelEditorScreen editor)
      Description copied from class: Conditional
      Primarily used in the ConditionalUI
      Specified by:
      getEditorConfiguration in class Conditional
      Parameters:
      editor - the LevelEditorScreen on which this menu will be spawned
      Returns:
      Some(CC) should this Conditional require additional configuration.