パッケージ mechanics.buff
クラス SimpleBuff
java.lang.Object
mechanics.buff.Buff
mechanics.buff.SimpleBuff
A concrete
Buff implementation that delegates stat application to a
Consumer<StatsContainer> lambda.
Use SimpleBuff when the buff effect can be expressed as a single
lambda, for example:
new SimpleBuff("Bennett Q ATK", 12.0, sim.getCurrentTime(),
s -> s.add(StatType.ATK_FLAT, bonus));
-
フィールドの概要
クラスから継承されたフィールド mechanics.buff.Buff
excludeChars, expirationTime, name, startTime, targetElement -
コンストラクタの概要
コンストラクタコンストラクタ説明SimpleBuff(String name, double duration, double currentTime, Consumer<StatsContainer> effect) Creates a time-limited buff whose effect is provided as a lambda. -
メソッドの概要
修飾子とタイプメソッド説明protected voidapplyStats(StatsContainer stats, double currentTime) Invokes the stored effect lambda to apply stat bonuses, if the effect is non-null.クラスから継承されたメソッド mechanics.buff.Buff
appliesToCharacter, apply, exclude, forElement, getName, isExpired
-
コンストラクタの詳細
-
SimpleBuff
public SimpleBuff(String name, double duration, double currentTime, Consumer<StatsContainer> effect) Creates a time-limited buff whose effect is provided as a lambda.- パラメータ:
name- display name used for logging and de-duplicationduration- how long the buff lasts in simulation secondscurrentTime- simulation time at which the buff startseffect- lambda that writes stat bonuses into the provided container
-
-
メソッドの詳細
-
applyStats
Invokes the stored effect lambda to apply stat bonuses, if the effect is non-null.- 定義:
applyStatsクラス内Buff- パラメータ:
stats- the stats container to modifycurrentTime- current simulation time in seconds (unused by this implementation)
-