Record Class AttackWindow.Builder<I>
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.rules.action.AttackWindow.Builder<I>
- Type Parameters:
I- plugin-defined input for each run- Record Components:
attackTick- function returning the relative tick when the player can attack
- Enclosing class:
AttackWindow
Builder for attack window scoring.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(ToIntFunction<I> attackTick) Creates an instance of aBuilderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattackTickrecord component.canAttack(Predicate<SimulationNode> canAttack) Adds the predicate required for a candidate node to be attack-ready.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Builder
Creates an instance of aBuilderrecord class.- Parameters:
attackTick- the value for theattackTickrecord component
-
-
Method Details
-
canAttack
Adds the predicate required for a candidate node to be attack-ready.- Parameters:
canAttack- additional attack predicate for the candidate node
-
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
-