1 Commits

Author SHA1 Message Date
4bb1e13f21 Added basic worker so tests can create them 2025-12-03 17:59:30 +01:00
5 changed files with 26 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,12 +1,22 @@
package hhn.temp.project; package hhn.temp.project;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
public class AssignmentManager { public class AssignmentManager {
List<Worker> workerList; Map<Integer, Worker> workerMap;
int workerIdCounter;
public AssignmentManager() { public AssignmentManager() {
workerList = new ArrayList<>(); workerMap = new HashMap<>();
int workerIdCounter = 1000;
}
public int createWorker(String name) {
Worker worker = new Worker(name, ++workerIdCounter);
workerMap.put(workerIdCounter, worker);
return workerIdCounter;
} }
} }

View File

@@ -1,4 +1,17 @@
package hhn.temp.project; package hhn.temp.project;
public class Worker { public class Worker {
String name;
int workerId;
public Worker(String name, int workerId) {
this.name = name;
this.workerId = workerId;
}
public String getName() {
return name;
}
public int getId() {
return workerId;
}
} }