From a00963768fe12338c685d5885d47173d7965e387 Mon Sep 17 00:00:00 2001 From: Caro Date: Tue, 18 Jun 2024 00:36:47 +0200 Subject: [PATCH] Merge --- TravelBuddyApp/src/main/java/domain/Auto.java | 1 + TravelBuddyApp/src/main/java/domain/KurztripEmpfehlung.java | 2 +- TravelBuddyApp/src/main/java/domain/Ort.java | 2 -- TravelBuddyApp/src/main/java/domain/Reiseplanung.java | 1 + TravelBuddyApp/src/main/java/domain/User.java | 1 + TravelBuddyApp/src/main/java/domain/WetterService.java | 1 + TravelBuddyApp/src/main/java/fassade/ReiseFassade.java | 2 +- TravelBuddyApp/src/main/java/fassade/UserFassade.java | 1 + TravelBuddyApp/src/main/java/ui/UserInterface.java | 1 + 9 files changed, 8 insertions(+), 4 deletions(-) diff --git a/TravelBuddyApp/src/main/java/domain/Auto.java b/TravelBuddyApp/src/main/java/domain/Auto.java index cb034b2..beee4d9 100644 --- a/TravelBuddyApp/src/main/java/domain/Auto.java +++ b/TravelBuddyApp/src/main/java/domain/Auto.java @@ -7,6 +7,7 @@ public class Auto { public Auto(String name, double co2AusstossProKm) { + this.name = name; this.co2AusstossProKm = co2AusstossProKm; } diff --git a/TravelBuddyApp/src/main/java/domain/KurztripEmpfehlung.java b/TravelBuddyApp/src/main/java/domain/KurztripEmpfehlung.java index 0ef8637..8c9738e 100644 --- a/TravelBuddyApp/src/main/java/domain/KurztripEmpfehlung.java +++ b/TravelBuddyApp/src/main/java/domain/KurztripEmpfehlung.java @@ -11,7 +11,7 @@ public class KurztripEmpfehlung { private Ort heimatort; public KurztripEmpfehlung(User user) { -// this.alleOrte = ladeAlleOrte(); + this.heimatort = null; } diff --git a/TravelBuddyApp/src/main/java/domain/Ort.java b/TravelBuddyApp/src/main/java/domain/Ort.java index 527b437..4e3d1c8 100644 --- a/TravelBuddyApp/src/main/java/domain/Ort.java +++ b/TravelBuddyApp/src/main/java/domain/Ort.java @@ -13,8 +13,6 @@ public class Ort { public Ort(int plz, String name) { this.plz = plz; this.name = name; -// this.breitengrad = breitengrad; -// this.längengrad = längengrad; } public String getAktuellesWetter() { diff --git a/TravelBuddyApp/src/main/java/domain/Reiseplanung.java b/TravelBuddyApp/src/main/java/domain/Reiseplanung.java index af540e0..3a47b2c 100644 --- a/TravelBuddyApp/src/main/java/domain/Reiseplanung.java +++ b/TravelBuddyApp/src/main/java/domain/Reiseplanung.java @@ -24,6 +24,7 @@ public class Reiseplanung { } public double berechneEntfernung(Ort standort, Ort zielort) { + double b1 = Math.toRadians(standort.getBreitengrad()); double b2 = Math.toRadians(zielort.getBreitengrad()); double l1 = Math.toRadians(standort.getLängengrad()); diff --git a/TravelBuddyApp/src/main/java/domain/User.java b/TravelBuddyApp/src/main/java/domain/User.java index e995b6a..44a74b7 100644 --- a/TravelBuddyApp/src/main/java/domain/User.java +++ b/TravelBuddyApp/src/main/java/domain/User.java @@ -92,6 +92,7 @@ public class User { } public boolean einloggen() { + try (BufferedReader reader = new BufferedReader(new FileReader("users.txt"))) { String line; while ((line = reader.readLine()) != null) { diff --git a/TravelBuddyApp/src/main/java/domain/WetterService.java b/TravelBuddyApp/src/main/java/domain/WetterService.java index 235575b..2f4e3af 100644 --- a/TravelBuddyApp/src/main/java/domain/WetterService.java +++ b/TravelBuddyApp/src/main/java/domain/WetterService.java @@ -13,6 +13,7 @@ import org.json.JSONObject; public class WetterService { + private static final String API_KEY = "fc01dfd47f80659f12512c295e80b201"; private static final HttpClient client = HttpClient.newHttpClient(); diff --git a/TravelBuddyApp/src/main/java/fassade/ReiseFassade.java b/TravelBuddyApp/src/main/java/fassade/ReiseFassade.java index e33da37..1213633 100644 --- a/TravelBuddyApp/src/main/java/fassade/ReiseFassade.java +++ b/TravelBuddyApp/src/main/java/fassade/ReiseFassade.java @@ -23,7 +23,7 @@ private KurztripEmpfehlung kurztripEmpfehlung; alleOrte = ladeAlleOrte(); - // this.kurztripEmpfehlung = new KurztripEmpfehlung(); + } public List ladeAlleOrte() { diff --git a/TravelBuddyApp/src/main/java/fassade/UserFassade.java b/TravelBuddyApp/src/main/java/fassade/UserFassade.java index 043d48f..31a3e39 100644 --- a/TravelBuddyApp/src/main/java/fassade/UserFassade.java +++ b/TravelBuddyApp/src/main/java/fassade/UserFassade.java @@ -18,6 +18,7 @@ public class UserFassade { } public User einloggen(String username, String password) { + User user = new User(username, password, null, null, 0, 0); if (user.einloggen()) { return user; diff --git a/TravelBuddyApp/src/main/java/ui/UserInterface.java b/TravelBuddyApp/src/main/java/ui/UserInterface.java index c0104a0..aa7c34f 100644 --- a/TravelBuddyApp/src/main/java/ui/UserInterface.java +++ b/TravelBuddyApp/src/main/java/ui/UserInterface.java @@ -28,6 +28,7 @@ public class UserInterface { boolean exit = false; System.out.println("\t\t\t Willkommen zur Travel-Buddy-App!"); System.out.println("\t\t\t --------------------------------"); + while (!exit) { System.out.println("1. Registrieren"); System.out.println("2. Einloggen");