Fixed assignment manager to pass some tests, scanner is not yet implemented fully

This commit is contained in:
2025-12-18 19:58:03 +01:00
parent 2af4f4b7a4
commit bb71c7e329
29 changed files with 279 additions and 73 deletions

View File

@@ -27,6 +27,9 @@ public class AssignmentManager {
return workerIdCounter;
}
public void removeWorker(int workerId) {
if (!workerMap.containsKey(workerId)) {
throw new IllegalArgumentException("WorkerId must exist in order to remove it");
}
workerMap.remove(workerId);
}
public int addTask(int workerId, String name, String description) {
@@ -74,5 +77,8 @@ public class AssignmentManager {
Task task = taskMap.get(taskId);
task.setTaskState(TaskState.IN_PROGRESS);
}
public UserCommands getUserCommands() {
return userInterface;
}
}

View File

@@ -3,18 +3,22 @@ package hhn.temp.project;
import java.util.Scanner;
public class UserCommands {
Scanner scanner;
public void start() {
boolean close = false;
Scanner scanner = new Scanner(System.in);
while (!close) {
System.out.println("Type '?' or 'help' for a list of commands");
System.out.println("Please enter a command:");
String input = scanner.nextLine();
handleInput(input);
}
scanner.close();
// scanner = new Scanner(System.in);
// while (!close) {
// System.out.println("Type '?' or 'help' for a list of commands");
// System.out.println("Please enter a command:");
// String input = scanner.nextLine();
// handleInput(input);
// }
// scanner.close();
}
public void handleInput(String input) {
}
public Scanner getScanner() {
return scanner;
}
}