diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class b/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class index 3301222..5734075 100644 Binary files a/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class and b/Code/Steiner/CO2-Daten-Projekt-V3/bin/App.class differ diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class b/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class index 1317d82..ac8d970 100644 Binary files a/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class and b/Code/Steiner/CO2-Daten-Projekt-V3/bin/Teacher.class differ diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java b/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java index 43b8a4f..e75cc80 100644 --- a/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java +++ b/Code/Steiner/CO2-Daten-Projekt-V3/src/App.java @@ -54,7 +54,7 @@ public class App { return averageCO2 / co2DataList.size(); // Example CO2 average level } - private static void calculateBreakPoints(double[] minuteData, Break calcBreak) { + private static void calculateBreakPoints(double[] minuteData, Break calcBreak, Teacher teacher) { int duration = calcBreak.getEnd().getMinute() - calcBreak.getStart().getMinute(); int breakPoints = minuteData.length; if (duration == minuteData.length) { @@ -63,9 +63,17 @@ public class App { breakPoints--; } } - } else System.out.println("Unexpected error"); + if (duration > 5) { + teacher.addPoints(0, breakPoints, 0); + } else { + teacher.addPoints(breakPoints, 0, 0); + } + + // check if next lesson is lunch another teacher or the same and plan + // accordingly + } private static void initializeTeachers() { @@ -161,6 +169,12 @@ public class App { initializeTeachers(); sortTeachers(); printTeachers(); + for (int classrooms = 0; classrooms < 3; classrooms++) { + for (int weekday = 0; weekday < 5; weekday++) { + // get the url and data + // calculate points + } + } // Loop threw each day with a specific classroom and after the weekdays are over // go to the next of the 3 classroms // go threw every break calculate the point and give them to the teacher diff --git a/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java b/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java index 36a84f9..0c98e5e 100644 --- a/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java +++ b/Code/Steiner/CO2-Daten-Projekt-V3/src/Teacher.java @@ -42,18 +42,6 @@ public class Teacher { this.points = new Points(); // Initialize Points object when Teacher is created } - // #region Timetable Methods - public void setTimetable(String day, String[] classes) { - if (day == null || classes == null || classes.length == 0) { - throw new IllegalArgumentException("Day and classes cannot be null or empty."); - } - timetable.put(day, classes); - } - - public String[] getTimetableForDay(String day) { - return timetable.getOrDefault(day, new String[0]); - } - // #region Getters and Setters public String getName() { return name; // Return the teacher's full name @@ -73,6 +61,12 @@ public class Teacher { this.points.setBonusPoints(bonusPoints); } + public void addPoints(int fiveMinute, int tenMinutes, int bonusPoints) { + this.points.addFiveMinuteBreakPoints(fiveMinute); + this.points.addLongerBreakPoints(tenMinutes); + this.points.addBonusPoints(bonusPoints); + } + public int getTotalPoints() { return this.points.getTotalPoints(); }