Macro systeem veralgemeniseerd naar Sequence. Sequence maakt het mogelijk om de automatische toegevoegde events bij macro's te omzeilen. Hier wordt gebruik van gemaakt bij de Continuous task, want deze moet alle vrijheid hebben. Nu is in de vele shortcut-sequence add functies nog geen beveiliging om oneindige Continuous tasks uit te voeren. De verantwoordelijkheid hiervoor ligt bij de gebruiker of een toekomstige controle.
This commit is contained in:
@@ -6,6 +6,7 @@ import pm.Task;
|
||||
|
||||
public class Continuous extends Task {
|
||||
protected int sleep;
|
||||
protected int iteration;
|
||||
protected boolean stop;
|
||||
|
||||
public Continuous(Action action, Target target, int sleep) {
|
||||
@@ -18,11 +19,16 @@ public class Continuous extends Task {
|
||||
this(action, target, 0);
|
||||
}
|
||||
|
||||
public void nextIteration() {
|
||||
++iteration;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
stop = true;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
iteration = 0;
|
||||
stop = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user