Record Class AttackWindow.PredicateBuilder<I>
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.rules.action.AttackWindow.PredicateBuilder<I>
- Type Parameters:
I- plugin-defined input for each run- Record Components:
attackTick- function returning the relative tick when the player can attackcanAttack- additional attack predicate for the candidate node
- Enclosing class:
AttackWindow
public static record AttackWindow.PredicateBuilder<I>(ToIntFunction<I> attackTick, Predicate<SimulationNode> canAttack)
extends Record
Builder for attack window scoring after the attack predicate has been set.
-
Constructor Summary
ConstructorsConstructorDescriptionPredicateBuilder(ToIntFunction<I> attackTick, Predicate<SimulationNode> canAttack) Creates an instance of aPredicateBuilderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattackTickrecord component.Returns the value of thecanAttackrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.score(int score) Builds an attack window task.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PredicateBuilder
Creates an instance of aPredicateBuilderrecord class.- Parameters:
attackTick- the value for theattackTickrecord componentcanAttack- the value for thecanAttackrecord component
-
-
Method Details
-
score
Builds an attack window task.- Parameters:
score- score added to attack-ready candidates
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
attackTick
Returns the value of theattackTickrecord component.- Returns:
- the value of the
attackTickrecord component
-
canAttack
Returns the value of thecanAttackrecord component.- Returns:
- the value of the
canAttackrecord component
-