BuilderActionTimerStart class
Пакет: com.hypixel.hytale.server.npc.corecomponents.timer.builders
Файл: com/hypixel/hytale/server/npc/corecomponents/timer/builders/BuilderActionTimerStart.java
extends: BuilderActionTimer
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
NumberArrayHolder |
startValueRange |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
return new |
ActionTimerreturn new ActionTimer(this, var1) |
public |
double |
getRatedouble getRate(@Nonnull BuilderSupport var1) |
public |
double[] |
getRestartValueRangedouble[] getRestartValueRange(@Nonnull BuilderSupport var1) |
public |
double[] |
getStartValueRangedouble[] getStartValueRange(@Nonnull BuilderSupport var1) |
public |
boolean |
isRepeatingboolean isRepeating(@Nonnull BuilderSupport var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.timer.builders;
class="kw">import com.google.gson.JsonElement;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderDescriptorState;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderSupport;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.holder.BooleanHolder;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.holder.DoubleHolder;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.holder.NumberArrayHolder;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.validators.DoubleSequenceValidator;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.validators.DoubleSingleValidator;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.timer.ActionTimer;
class="kw">import com.hypixel.hytale.server.npc.util.Timer;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BuilderActionTimerStart class="kw">extends BuilderActionTimer {
class="kw">protected class="kw">final NumberArrayHolder startValueRange = new NumberArrayHolder();
class="kw">protected class="kw">final NumberArrayHolder restartValueRange = new NumberArrayHolder();
class="kw">protected class="kw">final DoubleHolder rate = new DoubleHolder();
class="kw">protected class="kw">final BooleanHolder repeating = new BooleanHolder();
class="kw">public BuilderActionTimerStart() {
}
@Nonnull
class="kw">public ActionTimer build(@Nonnull BuilderSupport var1) {
class="kw">return new ActionTimer(this, var1);
}
@Nonnull
@Override
class="kw">public String getShortDescription() {
class="kw">return "Start a timer";
}
@Nonnull
@Override
class="kw">public String getLongDescription() {
class="kw">return "Start a timer";
}
@Nonnull
@Override
class="kw">public BuilderActionTimer readConfig(@Nonnull JsonElement var1) {
super.readConfig(var1);
this.requireDoubleRange(
var1,
"StartValueRange",
this.startValueRange,
DoubleSequenceValidator.fromExclToInclWeaklyMonotonic(0.0, Double.MAX_VALUE),
BuilderDescriptorState.Stable,
"The range from which to pick an initial value to start at",
null
);
this.requireDoubleRange(
var1,
"RestartValueRange",
this.restartValueRange,
DoubleSequenceValidator.fromExclToInclWeaklyMonotonic(0.0, Double.MAX_VALUE),
BuilderDescriptorState.Stable,
"The range from which to pick a value when the timer is restarted",
"The range from which to pick a value when the timer is restarted. The upper bound is also the timer max"
);
this.getDouble(
var1, "Rate", this.rate, 1.0, DoubleSingleValidator.greater0(), BuilderDescriptorState.Stable, "The rate at which the timer will decrease", null
);
this.getBoolean(var1, "Repeating", this.repeating, false, BuilderDescriptorState.Stable, "Whether to repeat the timer when countdown finishes", null);
class="kw">return this;
}
@Nonnull
@Override
class="kw">public Timer.TimerAction getTimerAction() {
class="kw">return Timer.TimerAction.START;
}
class="kw">public double[] getStartValueRange(@Nonnull BuilderSupport var1) {
class="kw">return this.startValueRange.get(var1.getExecutionContext());
}
class="kw">public double[] getRestartValueRange(@Nonnull BuilderSupport var1) {
class="kw">return this.restartValueRange.get(var1.getExecutionContext());
}
class="kw">public double getRate(@Nonnull BuilderSupport var1) {
class="kw">return this.rate.get(var1.getExecutionContext());
}
class="kw">public boolean isRepeating(@Nonnull BuilderSupport var1) {
class="kw">return this.repeating.get(var1.getExecutionContext());
}
}