Package dev.kitteh.factions.upgrade
Record Class Upgrade.Reactive
java.lang.Object
java.lang.Record
dev.kitteh.factions.upgrade.Upgrade.Reactive
- Record Components:
name- simple namenameComponent- decorated namedescription- decorated descriptiondetailsFunction- function converting upgrade settings to a decorated detail on a given levelmaxLevel- max level configurablevariables- variables usedreactor- response to a faction changing upgrade level
- All Implemented Interfaces:
Upgrade
- Enclosing interface:
Upgrade
public static record Upgrade.Reactive(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings,Integer,net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables, Upgrade.Reactor reactor)
extends Record
implements Upgrade
Optional helper record for creating a reactive upgrade.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.kitteh.factions.upgrade.Upgrade
Upgrade.Impl, Upgrade.Reactive, Upgrade.ReactiveImpl, Upgrade.Reactor, Upgrade.Simple, Upgrade.SimpleImpl -
Constructor Summary
ConstructorsConstructorDescriptionReactive(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables, Upgrade.Reactor reactor) Creates an instance of aReactiverecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentReturns the value of thedescriptionrecord component.net.kyori.adventure.text.Componentdetails(UpgradeSettings settings, int level) Gets details about a specific level of the upgrade, using available upgrade settings.BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> Returns the value of thedetailsFunctionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxLevel()Returns the value of themaxLevelrecord component.name()Returns the value of thenamerecord component.net.kyori.adventure.text.ComponentReturns the value of thenameComponentrecord component.voidCalled by the plugin when a faction changes level of this upgrade, potentially executing code.reactor()Returns the value of thereactorrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevariablesrecord component.
-
Constructor Details
-
Reactive
public Reactive(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables, Upgrade.Reactor reactor) Creates an instance of aReactiverecord class.- Parameters:
name- the value for thenamerecord componentnameComponent- the value for thenameComponentrecord componentdescription- the value for thedescriptionrecord componentdetailsFunction- the value for thedetailsFunctionrecord componentmaxLevel- the value for themaxLevelrecord componentvariables- the value for thevariablesrecord componentreactor- the value for thereactorrecord component
-
-
Method Details
-
details
Description copied from interface:UpgradeGets details about a specific level of the upgrade, using available upgrade settings. -
onChange
Description copied from interface:UpgradeCalled by the plugin when a faction changes level of this upgrade, potentially executing code. -
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 '=='. -
name
Returns the value of thenamerecord component. -
nameComponent
public net.kyori.adventure.text.Component nameComponent()Returns the value of thenameComponentrecord component.- Specified by:
nameComponentin interfaceUpgrade- Returns:
- the value of the
nameComponentrecord component
-
description
public net.kyori.adventure.text.Component description()Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceUpgrade- Returns:
- the value of the
descriptionrecord component
-
detailsFunction
Returns the value of thedetailsFunctionrecord component.- Returns:
- the value of the
detailsFunctionrecord component
-
maxLevel
public int maxLevel()Returns the value of themaxLevelrecord component. -
variables
Returns the value of thevariablesrecord component. -
reactor
Returns the value of thereactorrecord component.- Returns:
- the value of the
reactorrecord component
-