Record Class BattleRules
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.api.rules.BattleRules
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBattleRules(List<BattleRule> rules) Creates an instance of aBattleRulesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(BattleController controller) static BattleRules.Builderbuilder()combine(BattleRules other) static BattleRulesempty()final booleanIndicates whether some other object is "equal to" this one.List<net.minecraft.network.chat.Component> getFailureReasons(Pokemon... pokemon) List<net.minecraft.network.chat.Component> getFailureReasons(PartyStorage storage) List<net.minecraft.network.chat.Component> getFailureReasons(BattleParticipant participant) List<net.minecraft.network.chat.Component> getFailureReasons(Collection<Pokemon> pokemon) final inthashCode()Returns a hash code value for this object.booleanisEmpty()rules()Returns the value of therulesrecord component.final StringtoString()Returns a string representation of this record class.booleanbooleanvalidate(PartyStorage storage) booleanvalidate(BattleParticipant participant) booleanvalidate(Collection<Pokemon> pokemon) withRule(BattleRule rule) withRules(BattleRule... newRules) withRules(Collection<BattleRule> newRules)
-
Constructor Details
-
BattleRules
Creates an instance of aBattleRulesrecord class.- Parameters:
rules- the value for therulesrecord component
-
-
Method Details
-
empty
-
isEmpty
public boolean isEmpty() -
withRule
-
withRules
-
withRules
-
combine
-
apply
-
validate
-
validate
-
validate
-
validate
-
getFailureReasons
-
getFailureReasons
-
getFailureReasons
-
getFailureReasons
-
builder
-
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). -
rules
Returns the value of therulesrecord component.- Returns:
- the value of the
rulesrecord component
-