Add Javadoc comments, n&k to windup signs

This commit is contained in:
Daniel Saukel 2020-02-01 22:19:59 +01:00
parent c20e090914
commit b1342a8d76

View File

@ -19,23 +19,41 @@ import de.erethon.dungeonsxl.api.world.GameWorld;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
/** /**
* A sign with an attached task that does actions in a set interval <i>n</i> times, like a mob sign that spawns <i>n</i> mobs. It is similar to a {@link Rocker} * A sign with an attached task that does actions in a set interval {@link #n} times, like a mob sign that spawns {@link #n} mobs. It is similar to a
* as it expires (=is deactivated). * {@link Rocker} as it expires (=is deactivated).
* *
* @author Daniel Saukel * @author Daniel Saukel
*/ */
public abstract class Windup extends Deactivatable { public abstract class Windup extends Deactivatable {
protected double interval = -1; protected double interval = -1;
/**
* How many times the task is supposed to be executed (unless it is cancelled).
*/
protected int n;
/**
* How many times the task has been executed.
*/
protected int k;
protected Windup(DungeonsAPI api, Sign sign, String[] lines, GameWorld gameWorld) { protected Windup(DungeonsAPI api, Sign sign, String[] lines, GameWorld gameWorld) {
super(api, sign, lines, gameWorld); super(api, sign, lines, gameWorld);
} }
/**
* Returns the task interval in seconds.
*
* @return the task interval
*/
public double getIntervalSeconds() { public double getIntervalSeconds() {
return interval; return interval;
} }
/**
* Returns the task interval in seconds.
*
* @return the task interval
*/
public long getIntervalTicks() { public long getIntervalTicks() {
return (long) (interval * 20L); return (long) (interval * 20L);
} }