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 aBattleRules
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(BattleController controller) static BattleRules.Builder
builder()
combine
(BattleRules other) static BattleRules
empty()
final boolean
Indicates 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 int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
rules()
Returns the value of therules
record component.final String
toString()
Returns a string representation of this record class.boolean
boolean
validate
(PartyStorage storage) boolean
validate
(BattleParticipant participant) boolean
validate
(Collection<Pokemon> pokemon) withRule
(BattleRule rule) withRules
(BattleRule... newRules) withRules
(Collection<BattleRule> newRules)
-
Constructor Details
-
BattleRules
Creates an instance of aBattleRules
record class.- Parameters:
rules
- the value for therules
record 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 therules
record component.- Returns:
- the value of the
rules
record component
-