Mid-Work of changing the CLI to use State Machines so all input can be tested with the Tests using handleInput()
This commit is contained in:
@@ -13,6 +13,21 @@ public class UserCommands implements Runnable {
|
||||
private AtomicBoolean running = new AtomicBoolean(false);
|
||||
private Thread cliThread;
|
||||
|
||||
private enum InputState {
|
||||
MAIN_MENU,
|
||||
TASK_SELECTED,
|
||||
WORKER_SELECTED,
|
||||
AWAITING_EDIT_INPUT,
|
||||
AWAITING_CREATE_TASK_WORKER,
|
||||
AWAITING_CREATE_TASK_NAME,
|
||||
AWAITING_CREATE_TASK_DESC,
|
||||
AWAITING_CREATE_WORKER_NAME
|
||||
}
|
||||
|
||||
private InputState currentState = InputState.MAIN_MENU;
|
||||
private Integer tempWorkerId = null;
|
||||
private String tempTaskName = null;
|
||||
|
||||
public UserCommands(AssignmentManager manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user