prep
This commit is contained in:
parent
bda5461576
commit
c360825eb6
2 changed files with 16 additions and 5 deletions
BIN
bin/App.class
BIN
bin/App.class
Binary file not shown.
21
src/App.java
21
src/App.java
|
@ -30,7 +30,7 @@ public class App {
|
|||
"&end=" + formattedEndDateTime.replace(" ", "%20"));
|
||||
}
|
||||
|
||||
private static void calculateBreakPoints(Break calcBreak, Teacher teacher) {
|
||||
private static void calculateBreakPoints(Break calcBreak, Teacher teacher, Teacher nextTeacher) {
|
||||
int duration = calcBreak.getEnd() - calcBreak.getStart();
|
||||
Co2Data[] minuteData = calcBreak.getCo2Datas();
|
||||
|
||||
|
@ -52,8 +52,9 @@ public class App {
|
|||
teacher.addPoints(breakPoints, 0, 0);
|
||||
}
|
||||
|
||||
// bonus Point for teacher switch
|
||||
|
||||
if (teacher.getShortName() != nextTeacher.getShortName()) {
|
||||
// bonus Point for teacher switch
|
||||
}
|
||||
}
|
||||
|
||||
private static void initializeTeachers() {
|
||||
|
@ -217,15 +218,25 @@ public class App {
|
|||
|
||||
for (int i = 0; i < shortBreaks.length; i++) {
|
||||
Teacher teacher = findTeacherForBreak(i, timeTable, Arrays.asList(DATES).indexOf(date));
|
||||
Teacher nextTeacher = findTeacherForBreak(i + 1, timeTable,
|
||||
Arrays.asList(DATES).indexOf(date));
|
||||
if (teacher != null) {
|
||||
calculateBreakPoints(shortBreaks[i], teacher);
|
||||
if (nextTeacher == null) {
|
||||
nextTeacher = teacher;
|
||||
}
|
||||
calculateBreakPoints(shortBreaks[i], teacher, nextTeacher);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < longBreaks.length; i++) {
|
||||
Teacher teacher = findTeacherForBreak(i, timeTable, Arrays.asList(DATES).indexOf(date));
|
||||
Teacher nextTeacher = findTeacherForBreak(i + 1, timeTable,
|
||||
Arrays.asList(DATES).indexOf(date));
|
||||
if (teacher != null) {
|
||||
calculateBreakPoints(longBreaks[i], teacher);
|
||||
if (nextTeacher == null) {
|
||||
nextTeacher = teacher;
|
||||
}
|
||||
calculateBreakPoints(longBreaks[i], teacher, nextTeacher);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in a new issue