Expose ponder instruction addition

This commit is contained in:
PepperBell 2021-08-07 21:10:38 -07:00
parent 67a7726f1c
commit 019a61c444

View file

@ -192,6 +192,24 @@ public class SceneBuilder {
Direction.UP); Direction.UP);
} }
/**
* Adds an instruction to the scene. It is recommended to only use this method
* if another method in this class or its subclasses does not already allow
* adding a certain instruction.
*/
public void addInstruction(PonderInstruction instruction) {
scene.schedule.add(instruction);
}
/**
* Adds a simple instruction to the scene. It is recommended to only use this
* method if another method in this class or its subclasses does not already
* allow adding a certain instruction.
*/
public void addInstruction(Consumer<PonderScene> callback) {
addInstruction(PonderInstruction.simple(callback));
}
/** /**
* Before running the upcoming instructions, wait for a duration to let previous * Before running the upcoming instructions, wait for a duration to let previous
* actions play out. <br> * actions play out. <br>
@ -816,12 +834,4 @@ public class SceneBuilder {
} }
private void addInstruction(PonderInstruction instruction) {
scene.schedule.add(instruction);
}
private void addInstruction(Consumer<PonderScene> callback) {
scene.schedule.add(PonderInstruction.simple(callback));
}
} }