diff --git a/.gitignore b/.gitignore index c25f212..47af25b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,8 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +# Ignore Gradle project-specific cache directory .gradle -.idea + +# Ignore Gradle build output directory +build diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java new file mode 100644 index 0000000..bab3390 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Game.java @@ -0,0 +1,47 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +public class Game { + private Participant participant1, Participant2; + private int points1, points2; + private Location location; + + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public int getPoints1() { + return points1; + } + + public void setPoints1(int points1) { + this.points1 = points1; + } + + public int getPoints2() { + return points2; + } + + public void setPoints2(int points2) { + this.points2 = points2; + } + + public Participant getParticipant1() { + return participant1; + } + + public void setParticipant1(Participant participant1) { + this.participant1 = participant1; + } + + public Participant getParticipant2() { + return Participant2; + } + + public void setParticipant2(Participant participant2) { + Participant2 = participant2; + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Location.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Location.java new file mode 100644 index 0000000..448ae67 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Location.java @@ -0,0 +1,17 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +public class Location { + private String name; + + public Location(String name){ + setName(name); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Participant.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Participant.java new file mode 100644 index 0000000..e48f3a1 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Participant.java @@ -0,0 +1,6 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +public interface Participant { + String getName(); + void setName(String name); +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Person.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Person.java new file mode 100644 index 0000000..1165e7d --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Person.java @@ -0,0 +1,37 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +public class Person { + private String name; + private String firstName; + private String phoneNumber; + + public Person(String firstName, String name, String phoneNumber){ + setFirstName(firstName); + setName(name); + setPhoneNumber(phoneNumber); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java new file mode 100644 index 0000000..4273fd1 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Player.java @@ -0,0 +1,21 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import java.util.Date; + +public class Player extends Person implements Participant{ + + 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; + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java new file mode 100644 index 0000000..880cc13 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java @@ -0,0 +1,37 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import java.util.ArrayList; +import java.util.List; + +public class Team implements Participant { + private String name; + private List players; + private Person contactPerson; + + public Team(String name){ + setName(name); + players = new ArrayList<>(); + } + + public void addPlayer(Player player){ + players.add(player); + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + public Person getContactPerson() { + return contactPerson; + } + + public void setContactPerson(Person contactPerson) { + this.contactPerson = contactPerson; + } +} diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java new file mode 100644 index 0000000..5845a12 --- /dev/null +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Tournament.java @@ -0,0 +1,17 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +public class Tournament { + private String name; + + public Tournament(String name){ + setName(name); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +}