From 61a778ad545e048f7cc0d11c8608562f5ab0a761 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 28 Apr 2022 14:10:41 +0200 Subject: [PATCH 1/3] added Date of Birth to Player.java --- .../zhaw/projekt2/turnierverwaltung/Player.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java index 567f49b..4273fd1 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java @@ -1,10 +1,21 @@ package ch.zhaw.projekt2.turnierverwaltung; -public class Player extends Person{ +import java.util.Date; +public class Player extends Person implements Participant{ - public Player(String firstName, String name, String phoneNumber){ + private Date dateOfBirth; + + public Player(String firstName, String name, String phoneNumber, Date dateOfBirth){ super(firstName, name, phoneNumber); + setDateOfBirth(dateOfBirth); } + public Date getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(Date dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } } From 5d26137c8de3ab36a2f8a1af1da5425b77ab9239 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 28 Apr 2022 14:50:45 +0200 Subject: [PATCH 2/3] made Tournament not abstract. --- .../java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java index c6d6211..5845a12 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java @@ -1,6 +1,6 @@ package ch.zhaw.projekt2.turnierverwaltung; -public abstract class Tournament { +public class Tournament { private String name; public Tournament(String name){ From 263d79ba8e95a40d926fdb787963e0ca769a2ed4 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 28 Apr 2022 14:57:41 +0200 Subject: [PATCH 3/3] removed Class Tournamenttest.java --- .../main/java/ch/zhaw/projekt2/turnierverwaltung/App.java | 2 +- .../ch/zhaw/projekt2/turnierverwaltung/Tournamenttest.java | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournamenttest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java index 816e6f5..e04444b 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java @@ -16,7 +16,7 @@ public class App { System.out.println(new App().getGreeting()); FileIO io = new FileIO(System.getProperty("user.dir") + File.separator + "tournierverwaltung_angrynerds"); - Tournament tournament= new Tournamenttest("helloo"); + Tournament tournament= new Tournament("helloo"); io.saveTournament(tournament); diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournamenttest.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournamenttest.java deleted file mode 100644 index 2b259a9..0000000 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournamenttest.java +++ /dev/null @@ -1,7 +0,0 @@ -package ch.zhaw.projekt2.turnierverwaltung; - -public class Tournamenttest extends Tournament { - public Tournamenttest(String name) { - super(name); - } -}