Added repeat command

This commit is contained in:
Henry Mao 2013-01-11 22:41:57 +08:00
parent b6bfa34561
commit 9b4665a6b5

View file

@ -0,0 +1,27 @@
package assemblyline.common.machine.command;
/**
* This task resets all previous tasks and does them again in a loop.
*
* @author Calclavia
*
*/
public class CommandRepeat extends Command
{
/**
* The amount of tasks above this task to repeat.
*/
private int tasksToRepeat;
public void onTaskStart()
{
this.tasksToRepeat = this.getIntArg(0);
}
@Override
protected boolean doTask()
{
this.commandManager.setCurrentTask(this.commandManager.getCurrentTask() - this.tasksToRepeat);
return false;
}
}