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 theavailableActions
record component.private final int
The field for thecost
record component. -
Constructor Summary
ConstructorsConstructorDescriptionActionResult
(int cost) ActionResult
(List<Class<? extends Action>> availableActions) ActionResult
(List<Class<? extends Action>> availableActions, int cost) Creates an instance of aActionResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theavailableActions
record component.int
cost()
Returns the value of thecost
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
availableActions
The field for theavailableActions
record component. -
cost
private final int costThe field for thecost
record component.
-
-
Constructor Details
-
ActionResult
-
ActionResult
public ActionResult() -
ActionResult
public ActionResult(int cost) -
ActionResult
Creates an instance of aActionResult
record class.- Parameters:
availableActions
- the value for theavailableActions
record componentcost
- the value for thecost
record 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 theavailableActions
record component.- Returns:
- the value of the
availableActions
record component
-
cost
public int cost()Returns the value of thecost
record component.- Returns:
- the value of the
cost
record component
-