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
A base class for conditonals with two children
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConditionalThe left child of the conditonprotected ConditionalThe right child of the conditon -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionWhether or not to limit the number of children below this conditional By default assumes the condition can have no childrencom.badlogic.gdx.utils.Array<Conditional>Returns an array of this conditional dependents, if they have any.Optional<com.badlogic.gdx.scenes.scene2d.Actor>Primarily used in theConditionalUIbooleanpoll(GameContext ctx) Given the game context, return whether or not this conditional needs to be polled.voidread(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) booleanvoidsetChildren(Conditional... conds) voidwrite(com.badlogic.gdx.utils.Json json) Methods inherited from class group24.escaperoom.entities.properties.conditionals.Conditional
clone, equals, evaluate, getDisplay, getName, getType
-
Field Details
-
left
The left child of the conditon -
right
The right child of the conditon
-
-
Constructor Details
-
BinaryConditional
public BinaryConditional()
-
-
Method Details
-
requiresPoll
public boolean requiresPoll()- Overrides:
requiresPollin classConditional- Returns:
- whether or not this
Conditionalrequires polling
-
poll
Description copied from class:ConditionalGiven 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:
pollin classConditional- 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
- Overrides:
setChildrenin classConditional- Parameters:
conds- theConditionals to set
-
read
public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) -
getChildren
Description copied from class:ConditionalReturns an array of this conditional dependents, if they have any. The array will be the same length asConditional.childCount()- Overrides:
getChildrenin classConditional- Returns:
- an array of conditionals which this conditional depends on
-
childCount
Description copied from class:ConditionalWhether or not to limit the number of children below this conditional By default assumes the condition can have no children- Overrides:
childCountin classConditional- 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:ConditionalPrimarily used in theConditionalUI- Specified by:
getEditorConfigurationin classConditional- Parameters:
editor- theLevelEditorScreenon which this menu will be spawned- Returns:
- Some(CC) should this
Conditionalrequire additional configuration.
-