From f0da7b0f9ad3ba85fd9630fb5ebeeecd942e84b7 Mon Sep 17 00:00:00 2001 From: KevinSchoenmayer Date: Sun, 4 Jan 2026 16:27:53 +0100 Subject: [PATCH] Mid-Work of changing the CLI to use State Machines so all input can be tested with the Tests using handleInput() --- src/main/java/hhn/temp/project/UserCommands.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/hhn/temp/project/UserCommands.java b/src/main/java/hhn/temp/project/UserCommands.java index a5862043..76a3b95d 100644 --- a/src/main/java/hhn/temp/project/UserCommands.java +++ b/src/main/java/hhn/temp/project/UserCommands.java @@ -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; }