changes made
This commit is contained in:
parent
e192af4647
commit
bda5461576
8 changed files with 173 additions and 151 deletions
BIN
bin/App.class
BIN
bin/App.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
228
src/App.java
228
src/App.java
|
@ -8,58 +8,94 @@ import java.util.Scanner;
|
||||||
public class App {
|
public class App {
|
||||||
// #region app constants
|
// #region app constants
|
||||||
private static final Scanner scanner = new Scanner(System.in);
|
private static final Scanner scanner = new Scanner(System.in);
|
||||||
private static final Teacher[] teachers = new Teacher[Teacher.nameMap.size()];
|
private static Teacher[] teachers = new Teacher[Teacher.nameMap.size()]; // problem
|
||||||
|
|
||||||
// Room channel numbers, sorted asc. 37, 38, 39
|
// Room channel numbers, sorted in ascending order: 37, 38, 39
|
||||||
private static final int[] ROOM_NUMBERS = { 1521263, 1364580, 1521262 };
|
private static final int[] ROOM_NUMBERS = { 1521263, 1364580, 1521262 };
|
||||||
|
|
||||||
// Date and time constants for Start and End Dates
|
// Date constants for Start and End Dates
|
||||||
private static final String[] DATES = { "2024-11-04", "2024-11-05", "2024-11-06", "2024-11-07", "2024-11-08" };
|
private static final String[] DATES = { "2024-11-04", "2024-11-05", "2024-11-06", "2024-11-07", "2024-11-08" };
|
||||||
|
|
||||||
private static ArrayList<Break[]> SHORT_BREAKS = new ArrayList<Break[]>();
|
private static final ArrayList<Break[]> SHORT_BREAKS = new ArrayList<>();
|
||||||
private static ArrayList<Break[]> LONG_BREAKS = new ArrayList<Break[]>();
|
private static final ArrayList<Break[]> LONG_BREAKS = new ArrayList<>();
|
||||||
|
|
||||||
// #region Initialization
|
// #region Initialization
|
||||||
|
|
||||||
public static URL generateLink(int channelNumber, String date) throws MalformedURLException {
|
public static URL generateLink(int channelNumber, String date) throws MalformedURLException {
|
||||||
String baseUrl = "https://api.thingspeak.com/channels/";
|
String baseUrl = "https://api.thingspeak.com/channels/";
|
||||||
String formattedStartDateTime = date + " 07:00:00";
|
String formattedStartDateTime = date + " 07:00:00";
|
||||||
String formattedEndDateTime = date + " 19:00:00";
|
String formattedEndDateTime = date + " 19:00:00";
|
||||||
|
|
||||||
return new URL(baseUrl + channelNumber + "/feeds.csv?start=" + formattedStartDateTime.replace(" ", "%20")
|
return new URL(baseUrl + channelNumber + "/feeds.csv?start=" +
|
||||||
+ "&end=" + formattedEndDateTime.replace(" ", "%20")); // %20 --> " "
|
formattedStartDateTime.replace(" ", "%20") +
|
||||||
|
"&end=" + formattedEndDateTime.replace(" ", "%20"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void calculateBreakPoints(Break calcBreak, Teacher teacher) {
|
private static void calculateBreakPoints(Break calcBreak, Teacher teacher) {
|
||||||
int duration = calcBreak.getEnd() - calcBreak.getStart();
|
int duration = calcBreak.getEnd() - calcBreak.getStart();
|
||||||
Co2Data[] minuteData = calcBreak.getCo2Datas();
|
Co2Data[] minuteData = calcBreak.getCo2Datas();
|
||||||
|
|
||||||
|
if (minuteData.length != duration) {
|
||||||
|
System.out.println("Data inconsistency detected: duration mismatch.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int breakPoints = minuteData.length;
|
int breakPoints = minuteData.length;
|
||||||
if (duration == minuteData.length) {
|
for (int i = 0; i < duration - 1; i++) {
|
||||||
for (int i = 0; i < duration; i++) {
|
if (minuteData[i].getCo2Level() < minuteData[i + 1].getCo2Level()) {
|
||||||
if (i + 1 != duration && (minuteData[i].getCo2Level() < minuteData[i + 1].getCo2Level())) {
|
|
||||||
breakPoints--;
|
breakPoints--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
System.out.println("Unexpected error");
|
|
||||||
if (duration > 5) {
|
if (duration > 5) {
|
||||||
teacher.addPoints(0, breakPoints, 0);
|
teacher.addPoints(0, breakPoints, 0);
|
||||||
} else {
|
} else {
|
||||||
teacher.addPoints(breakPoints, 0, 0);
|
teacher.addPoints(breakPoints, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if next lesson is lunch another teacher or the same and plan
|
// bonus Point for teacher switch
|
||||||
// accordingly
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initializeTeachers() {
|
private static void initializeTeachers() {
|
||||||
|
// Mapping short names to full teacher names
|
||||||
|
Teacher.nameMap.put("Hm", "Johann Hummel");
|
||||||
|
Teacher.nameMap.put("Bd", "Fender Bender");
|
||||||
|
Teacher.nameMap.put("Bu", "Luca Burger");
|
||||||
|
Teacher.nameMap.put("Cg", "Jesus Chung");
|
||||||
|
Teacher.nameMap.put("Do", "Brother Doe");
|
||||||
|
Teacher.nameMap.put("Eh", "Johnny Ehrlich");
|
||||||
|
Teacher.nameMap.put("Fh", "Karl Fischer");
|
||||||
|
Teacher.nameMap.put("Gi", "Bobby Giordano");
|
||||||
|
Teacher.nameMap.put("Gr", "Graham");
|
||||||
|
Teacher.nameMap.put("Hi", "Higgins");
|
||||||
|
Teacher.nameMap.put("Kg", "Kang");
|
||||||
|
Teacher.nameMap.put("Kh", "Khan");
|
||||||
|
Teacher.nameMap.put("Lz", "Lozano");
|
||||||
|
Teacher.nameMap.put("Lu", "Lund");
|
||||||
|
Teacher.nameMap.put("Or", "Ortega");
|
||||||
|
Teacher.nameMap.put("Re", "Reyes");
|
||||||
|
Teacher.nameMap.put("Se", "Seng");
|
||||||
|
Teacher.nameMap.put("Ts", "Tanaka");
|
||||||
|
Teacher.nameMap.put("Vt", "Vetter");
|
||||||
|
Teacher.nameMap.put("Zu", "Zuniga");
|
||||||
|
Teacher.nameMap.put("Kp", "Kevin Peters");
|
||||||
|
Teacher.nameMap.put("KP", "Kevin Peters");
|
||||||
|
Teacher.nameMap.put("Ba", "Barbara Allen");
|
||||||
|
Teacher.nameMap.put("Bz", "Basil Zephyr");
|
||||||
|
Teacher.nameMap.put("Hn", "Hannah Nguyen");
|
||||||
|
Teacher.nameMap.put("Le", "Full Name for Le");
|
||||||
|
Teacher.nameMap.put("Du", "Full Name for Du");
|
||||||
|
Teacher.nameMap.put("Bt", "Full Name for Bt");
|
||||||
|
Teacher.nameMap.put("Es", "Full Name for Es");
|
||||||
|
Teacher.nameMap.put("Hu", "Full Name for Hu");
|
||||||
|
Teacher.nameMap.put("Ge", "Full Name for Ge");
|
||||||
|
|
||||||
|
// Initialize the teachers array with the size of nameMap
|
||||||
|
teachers = new Teacher[Teacher.nameMap.size()];
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (String initial : Teacher.nameMap.keySet()) {
|
for (String initial : Teacher.nameMap.keySet()) {
|
||||||
Teacher teacher = new Teacher(initial);
|
Teacher teacher = new Teacher(initial);
|
||||||
Points points = new Points(); // Initialize Points object for each teacher
|
|
||||||
teacher.setPoints(points.getLongerBreak(), points.getBonusPoints(), points.getFiveMinuteBreak());
|
|
||||||
teachers[index++] = teacher;
|
teachers[index++] = teacher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,10 +107,26 @@ public class App {
|
||||||
if (scanner.hasNextInt()) {
|
if (scanner.hasNextInt()) {
|
||||||
return scanner.nextInt();
|
return scanner.nextInt();
|
||||||
}
|
}
|
||||||
scanner.next(); // Clear invalid input
|
System.out.println("Invalid input. Please enter a number.");
|
||||||
|
scanner.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void interactWithUser() {
|
||||||
|
while (true) {
|
||||||
|
int userInput = getUserInput("Do you want to see how the points were calculated? (1 = Yes, 0 = No)");
|
||||||
|
if (userInput == 1) {
|
||||||
|
printExplanation();
|
||||||
|
break;
|
||||||
|
} else if (userInput == 0) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
System.out.println("Invalid input. Please enter 1 for Yes or 0 for No.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
// #region Explanation
|
// #region Explanation
|
||||||
private static void printExplanation() {
|
private static void printExplanation() {
|
||||||
System.out.println("Point calculation explanation:");
|
System.out.println("Point calculation explanation:");
|
||||||
|
@ -83,8 +135,8 @@ public class App {
|
||||||
System.out.println("3. 5 bonus points for teacher switches in classrooms.");
|
System.out.println("3. 5 bonus points for teacher switches in classrooms.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region shutdown
|
// #region Shutdown
|
||||||
private static void printShutDown() {
|
private static void printShutdown() {
|
||||||
System.out.println("Shutting down...");
|
System.out.println("Shutting down...");
|
||||||
for (int i = 3; i > 0; i--) {
|
for (int i = 3; i > 0; i--) {
|
||||||
System.out.print(i + "...");
|
System.out.print(i + "...");
|
||||||
|
@ -96,94 +148,100 @@ public class App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #TODO: remove this before hand-in deadline
|
// #region Print & Sort
|
||||||
public static void debbugingValueLists(List<Co2Data> data) {
|
|
||||||
// Debugging co2Data
|
|
||||||
int index = 0;
|
|
||||||
for (Co2Data a : data) {
|
|
||||||
System.out.println(a.toString());
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("-----------------");
|
|
||||||
System.out.println(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
// #TODO
|
|
||||||
// #region Print & sort
|
|
||||||
private static void sortTeachers() {
|
private static void sortTeachers() {
|
||||||
// Sorting teachers by total points (implement sorting logic based on points)
|
|
||||||
Arrays.sort(teachers,
|
Arrays.sort(teachers,
|
||||||
(a, b) -> Integer.compare(b.getPoints().getTotalPoints(), a.getPoints().getTotalPoints()));
|
(a, b) -> Integer.compare(b.getTotalPoints(), a.getTotalPoints()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void printTeachers() {
|
private static void printTeachers() {
|
||||||
int rank = 1;
|
int rank = 1;
|
||||||
int previousPoints = -1;
|
int previousPoints = -1;
|
||||||
int currentRank = 1;
|
|
||||||
|
|
||||||
for (int i = 0; i < teachers.length; i++) {
|
for (int i = 0; i < teachers.length; i++) {
|
||||||
Teacher teacher = teachers[i];
|
Teacher teacher = teachers[i];
|
||||||
int teacherPoints = teacher.getPoints().getTotalPoints(); // Assuming points are available in getPoints()
|
int teacherPoints = teacher.getTotalPoints();
|
||||||
|
|
||||||
if (teacherPoints == previousPoints) {
|
|
||||||
System.out.println(currentRank + ". " + teacher.getName() + " " + teacherPoints);
|
|
||||||
} else {
|
|
||||||
if (i > 0) {
|
|
||||||
rank += (i - (currentRank - 1));
|
|
||||||
}
|
|
||||||
currentRank = rank;
|
|
||||||
System.out.println(rank + ". " + teacher.getName() + " " + teacherPoints);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (teacherPoints != previousPoints) {
|
||||||
|
rank = i + 1;
|
||||||
previousPoints = teacherPoints;
|
previousPoints = teacherPoints;
|
||||||
}
|
}
|
||||||
|
System.out.println(rank + ". " + teacher.getName() + " - Points: " + teacherPoints);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region Main
|
private static Teacher findTeacherForBreak(int breakIndex, TimeTable timeTable, int dayIndex) {
|
||||||
public static void main(String[] args) throws MalformedURLException {
|
String teacherShortName = timeTable.getLesson(breakIndex, dayIndex);
|
||||||
System.out.println("Calculations in process please do not shut off...");
|
|
||||||
|
if (teacherShortName == null || teacherShortName.isEmpty()) {
|
||||||
|
System.out.println("No teacher assigned during this break.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!Teacher.nameMap.containsKey(teacherShortName) && teacherShortName != "Lunch") {
|
||||||
|
System.out.println("Teacher with short name " + teacherShortName + " not found in Teacher.nameMap.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String fullName = Teacher.nameMap.get(teacherShortName);
|
||||||
|
for (Teacher teacher : teachers) {
|
||||||
|
if (teacher.getName().equals(fullName)) {
|
||||||
|
return teacher;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #region main
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
System.out.println("Calculations in process. Please do not shut off...");
|
||||||
initializeTeachers();
|
initializeTeachers();
|
||||||
|
|
||||||
ArrayList<Break> co2Datas = new ArrayList<Break>();
|
for (int roomIndex = 0; roomIndex < ROOM_NUMBERS.length; roomIndex++) {
|
||||||
for (int classrooms = 0; classrooms < 3; classrooms++) {
|
TimeTable timeTable = new TimeTable(roomIndex);
|
||||||
for (int weekday = 0; weekday < 5; weekday++) {
|
|
||||||
List<Co2Data> tempData = Co2Data.getData(generateLink(ROOM_NUMBERS[classrooms], DATES[weekday]));
|
for (String date : DATES) {
|
||||||
SHORT_BREAKS.add(BreakSchedule.createBreaks(BreakSchedule.START_SMALL_BREAK,
|
try {
|
||||||
BreakSchedule.END_SMALL_BREAK, tempData));
|
List<Co2Data> tempData = Co2Data.getData(generateLink(ROOM_NUMBERS[roomIndex], date));
|
||||||
LONG_BREAKS.add(BreakSchedule.createBreaks(BreakSchedule.START_LONG_BREAK,
|
if (tempData == null || tempData.isEmpty()) {
|
||||||
BreakSchedule.END_LONG_BREAK, tempData));
|
System.out
|
||||||
|
.println("No data available for " + date + " in Room" + (roomIndex + 37) + ".");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Break[] shortBreaks = BreakSchedule.createBreaks(
|
||||||
|
BreakSchedule.START_SMALL_BREAK, BreakSchedule.END_SMALL_BREAK, tempData);
|
||||||
|
|
||||||
|
Break[] longBreaks = BreakSchedule.createBreaks(
|
||||||
|
BreakSchedule.START_LONG_BREAK, BreakSchedule.END_LONG_BREAK, tempData);
|
||||||
|
|
||||||
|
for (int i = 0; i < shortBreaks.length; i++) {
|
||||||
|
Teacher teacher = findTeacherForBreak(i, timeTable, Arrays.asList(DATES).indexOf(date));
|
||||||
|
if (teacher != null) {
|
||||||
|
calculateBreakPoints(shortBreaks[i], teacher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateBreakPoints(SHORT_BREAKS.get(0)[0], teachers[0]);
|
for (int i = 0; i < longBreaks.length; i++) {
|
||||||
|
Teacher teacher = findTeacherForBreak(i, timeTable, Arrays.asList(DATES).indexOf(date));
|
||||||
// Loop threw each day with a specific classroom and after the weekdays are over
|
if (teacher != null) {
|
||||||
// go to the next of the 3 classroms
|
calculateBreakPoints(longBreaks[i], teacher);
|
||||||
// go threw every break calculate the point and give them to the teacher
|
}
|
||||||
// directly
|
}
|
||||||
// remember the point class
|
} catch (Exception e) {
|
||||||
// BreakSchedule needed
|
System.out.println("Error processing data for date: " + date + ". " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sortTeachers();
|
sortTeachers();
|
||||||
printTeachers();
|
printTeachers();
|
||||||
|
interactWithUser();
|
||||||
|
|
||||||
while (true) {
|
} catch (Exception e) {
|
||||||
int userInput = getUserInput(
|
System.out.println("Fatal error: " + e.getMessage());
|
||||||
"Do you want to see how the points were calculated? (Yes 1, No 0; anything is an error)");
|
} finally {
|
||||||
if (userInput == 1) {
|
|
||||||
printExplanation();
|
|
||||||
// add a more detailed listing of the teacher since points can be broken down
|
|
||||||
// further
|
|
||||||
printShutDown();
|
|
||||||
break;
|
|
||||||
} else if (userInput == 0) {
|
|
||||||
printShutDown();
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
System.out.println("Invalid input. Please enter 1 for Yes or 0 for No.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scanner.close();
|
scanner.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ public class BreakSchedule {
|
||||||
Co2Data[] co2Datas = new Co2Data[endTimes[i] - startTimes[i]];
|
Co2Data[] co2Datas = new Co2Data[endTimes[i] - startTimes[i]];
|
||||||
for (Co2Data data : co2Data) {
|
for (Co2Data data : co2Data) {
|
||||||
if (data.getTime() >= startTimes[i] && data.getTime() < endTimes[i]) {
|
if (data.getTime() >= startTimes[i] && data.getTime() < endTimes[i]) {
|
||||||
System.out.println(startTimes[i] + " " + endTimes[i] + " " + data.getTime());
|
|
||||||
co2Datas[data.getTime() - startTimes[i]] = data;
|
co2Datas[data.getTime() - startTimes[i]] = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class Co2Data {
|
||||||
br.readLine(); // Skip header line
|
br.readLine(); // Skip header line
|
||||||
|
|
||||||
String output;
|
String output;
|
||||||
System.out.println(url);
|
|
||||||
while ((output = br.readLine()) != null) {
|
while ((output = br.readLine()) != null) {
|
||||||
Co2Data data = parseData(output);
|
Co2Data data = parseData(output);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
|
|
|
@ -1,73 +1,39 @@
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class Teacher {
|
public class Teacher {
|
||||||
// #region Fields
|
|
||||||
private String name;
|
|
||||||
private Map<String, String[]> timetable = new HashMap<>(); // Map of Day -> Teachers in class for that day
|
|
||||||
private Points points; // Points field to store teacher's points
|
|
||||||
|
|
||||||
public static final Map<String, String> nameMap = new HashMap<>();
|
public static final Map<String, String> nameMap = new HashMap<>();
|
||||||
|
private String shortName;
|
||||||
|
private String name;
|
||||||
|
private int totalPoints;
|
||||||
|
|
||||||
// #region Initialization
|
// Constructor
|
||||||
static {
|
public Teacher(String shortName) {
|
||||||
// Mapping short names to full teacher names
|
this.shortName = shortName;
|
||||||
nameMap.put("Hm", "Johann Hummel");
|
this.name = nameMap.get(shortName);
|
||||||
nameMap.put("Bd", "Fender Bender");
|
this.totalPoints = 0;
|
||||||
nameMap.put("Bu", "Luca Burger");
|
|
||||||
nameMap.put("Cg", "Jesus Chung");
|
|
||||||
nameMap.put("Do", "Brother Doe");
|
|
||||||
nameMap.put("Eh", "Johnny Ehrlich");
|
|
||||||
nameMap.put("Fh", "Karl Fischer");
|
|
||||||
nameMap.put("Gi", "Bobby Giordano");
|
|
||||||
nameMap.put("Gr", "Graham");
|
|
||||||
nameMap.put("Hi", "Higgins");
|
|
||||||
nameMap.put("Kg", "Kang");
|
|
||||||
nameMap.put("Kh", "Khan");
|
|
||||||
nameMap.put("Lz", "Lozano");
|
|
||||||
nameMap.put("Lu", "Lund");
|
|
||||||
nameMap.put("Or", "Ortega");
|
|
||||||
nameMap.put("Re", "Reyes");
|
|
||||||
nameMap.put("Se", "Seng");
|
|
||||||
nameMap.put("Ts", "Tanaka");
|
|
||||||
nameMap.put("Vt", "Vetter");
|
|
||||||
nameMap.put("Zu", "Zuniga");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region Constructor
|
// Getters
|
||||||
public Teacher(String name) {
|
public String getShortName() {
|
||||||
// Use the short name to find the full name from the nameMap
|
return shortName;
|
||||||
this.name = nameMap.getOrDefault(name, "Unknown");
|
|
||||||
this.points = new Points(); // Initialize Points object when Teacher is created
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #region Getters and Setters
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name; // Return the teacher's full name
|
return name;
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String[]> getTimetable() {
|
|
||||||
return Collections.unmodifiableMap(timetable); // Return an unmodifiable view of the timetable
|
|
||||||
}
|
|
||||||
|
|
||||||
public Points getPoints() {
|
|
||||||
return points; // Return the Points object associated with the teacher
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPoints(int fiveMinute, int tenMinutes, int bonusPoints) {
|
|
||||||
this.points.setFiveMinuteBreak(fiveMinute);
|
|
||||||
this.points.setLongerBreak(tenMinutes);
|
|
||||||
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() {
|
public int getTotalPoints() {
|
||||||
return this.points.getTotalPoints();
|
return totalPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
public void setTotalPoints(int points) {
|
||||||
|
this.totalPoints = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method to add points
|
||||||
|
public void addPoints(int smallBreakPoints, int longBreakPoints, int bonusPoints) {
|
||||||
|
this.totalPoints += smallBreakPoints + longBreakPoints + bonusPoints;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue