Package com.takenoko.actions
Record Class ActionResult
java.lang.Object
java.lang.Record
com.takenoko.actions.ActionResult
- Record Components:
availableActions- the availableActions available to the bot after the actioncost- the cost of the action
This class represents the result of an action.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theavailableActionsrecord component.private final intThe field for thecostrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionActionResult(int cost) ActionResult(List<Class<? extends Action>> availableActions) ActionResult(List<Class<? extends Action>> availableActions, int cost) Creates an instance of aActionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theavailableActionsrecord component.intcost()Returns the value of thecostrecord component.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.
-
Field Details
-
availableActions
The field for theavailableActionsrecord component. -
cost
private final int costThe field for thecostrecord component.
-
-
Constructor Details
-
ActionResult
-
ActionResult
public ActionResult() -
ActionResult
public ActionResult(int cost) -
ActionResult
Creates an instance of aActionResultrecord class.- Parameters:
availableActions- the value for theavailableActionsrecord componentcost- the value for thecostrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
availableActions
Returns the value of theavailableActionsrecord component.- Returns:
- the value of the
availableActionsrecord component
-
cost
public int cost()Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-