Record Class BattleOutcome
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.BattleOutcome
public record BattleOutcome(BattleEndCause cause, boolean abnormal, Map<BattleParticipant,BattleResults> participantResults)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionBattleOutcome(BattleEndCause cause, boolean abnormal, Map<BattleParticipant, BattleResults> participantResults) Creates an instance of aBattleOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabnormal()Returns the value of theabnormalrecord component.cause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.findParticipant(net.minecraft.world.entity.Entity entity) final inthashCode()Returns a hash code value for this object.booleanisDefeat(BattleParticipant participant) booleanisDefeat(net.minecraft.world.entity.Entity entity) booleanisDraw(BattleParticipant participant) booleanisDraw(net.minecraft.world.entity.Entity entity) booleanisFlee(BattleParticipant participant) booleanisFlee(net.minecraft.world.entity.Entity entity) booleanisVictory(BattleParticipant participant) booleanisVictory(net.minecraft.world.entity.Entity entity) losers()Returns the value of theparticipantResultsrecord component.resultFor(BattleParticipant participant) resultFor(net.minecraft.world.entity.Entity entity) final StringtoString()Returns a string representation of this record class.winners()
-
Constructor Details
-
BattleOutcome
public BattleOutcome(BattleEndCause cause, boolean abnormal, Map<BattleParticipant, BattleResults> participantResults) Creates an instance of aBattleOutcomerecord class.- Parameters:
cause- the value for thecauserecord componentabnormal- the value for theabnormalrecord componentparticipantResults- the value for theparticipantResultsrecord component
-
-
Method Details
-
resultFor
-
resultFor
-
isVictory
public boolean isVictory(net.minecraft.world.entity.Entity entity) -
isVictory
-
isDefeat
public boolean isDefeat(net.minecraft.world.entity.Entity entity) -
isDefeat
-
isDraw
public boolean isDraw(net.minecraft.world.entity.Entity entity) -
isDraw
-
isFlee
public boolean isFlee(net.minecraft.world.entity.Entity entity) -
isFlee
-
winners
-
losers
-
findParticipant
-
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 '=='. -
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-
abnormal
public boolean abnormal()Returns the value of theabnormalrecord component.- Returns:
- the value of the
abnormalrecord component
-
participantResults
Returns the value of theparticipantResultsrecord component.- Returns:
- the value of the
participantResultsrecord component
-