From 7cecb26a5adf324f171a741fe1ab124e2b79ed15 Mon Sep 17 00:00:00 2001 From: Artem Didytschuk Date: Tue, 1 Mar 2022 11:30:07 +0100 Subject: [PATCH] =?UTF-8?q?Methodenk=C3=B6pfe=20f=C3=BCr=20Query=20und=20U?= =?UTF-8?q?ser;=20Objektdiagram=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++ Query.java | 22 ++++ Queue.java | 2 +- Server.java | 2 +- User.java | 96 ++++++++++++++++ .../Objektdiagramm Wordle Projekt.uxf | 105 +++++++++--------- 6 files changed, 182 insertions(+), 52 deletions(-) create mode 100644 Query.java create mode 100644 User.java diff --git a/.gitignore b/.gitignore index 173985e..7f4282f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,10 @@ hs_err_pid* # Engine-Alpha files engine-alpha.log +# intelliJ +/.idea/misc.xml +/.idea/modules.xml +/.idea/vcs.xml +/git.iml +/out/ +/.idea/.gitignore diff --git a/Query.java b/Query.java new file mode 100644 index 0000000..93ced41 --- /dev/null +++ b/Query.java @@ -0,0 +1,22 @@ +public class Query { + DatabaseConnector db; + + Query(){ + db = new DatabaseConnector("", 0, "wordle.db", "", ""); + } + public void pullStats(){ + + } + + public void pushStats(){ + + } + + public void checkLogin(String username, String password){ + + } + + public String getWord(){ + return ""; + } +} diff --git a/Queue.java b/Queue.java index b6f9c59..9cd3791 100644 --- a/Queue.java +++ b/Queue.java @@ -19,7 +19,7 @@ public class Queue { /* --------- Anfang der privaten inneren Klasse -------------- */ - private class QueueNode { + public class QueueNode { private ContentType content = null; private QueueNode nextNode = null; diff --git a/Server.java b/Server.java index d21a506..bb53c28 100644 --- a/Server.java +++ b/Server.java @@ -30,7 +30,7 @@ public abstract class Server private NewConnectionHandler connectionHandler; private List messageHandlers; - private class NewConnectionHandler extends Thread + public class NewConnectionHandler extends Thread { private ServerSocket serverSocket; private boolean active; diff --git a/User.java b/User.java new file mode 100644 index 0000000..7afeef4 --- /dev/null +++ b/User.java @@ -0,0 +1,96 @@ +public class User { + int connectionID; + String username; + String password; + int timesPlayed; + int winPercentage; + int currentStreak; + int maxStreak; + int lastDayWOTDFinished; + int state; + int [] wonInTurn; + + public User (int pConnectionID, Query pQuery){ + connectionID =pConnectionID; + } + + public int getConnectionID() { + return connectionID; + } + + public int getCurrentStreak() { + return currentStreak; + } + + public int getLastDayWOTDFinished() { + return lastDayWOTDFinished; + } + + public int getMaxStreak() { + return maxStreak; + } + + public int getTimesPlayed() { + return timesPlayed; + } + + public int getState() { + return state; + } + + public int getWinPercentage() { + return winPercentage; + } + + public int[] getWonInTurn() { + return wonInTurn; + } + + public String getPassword() { + return password; + } + + public String getUsername() { + return username; + } + + public void setConnectionID(int connectionID) { + this.connectionID = connectionID; + } + + public void setCurrentStreak(int currentStreak) { + this.currentStreak = currentStreak; + } + + public void setLastDayWOTDFinished(int lastDayWOTDFinished) { + this.lastDayWOTDFinished = lastDayWOTDFinished; + } + + public void setMaxStreak(int maxStreak) { + this.maxStreak = maxStreak; + } + + public void setPassword(String password) { + this.password = password; + } + + public void setState(int state) { + this.state = state; + } + + public void setTimesPlayed(int timesPlayed) { + this.timesPlayed = timesPlayed; + } + + public void setUsername(String username) { + this.username = username; + } + + public void setWinPercentage(int winPercentage) { + this.winPercentage = winPercentage; + } + + public void setWonInTurn(int[] wonInTurn) { + this.wonInTurn = wonInTurn; + } +} diff --git a/Wordle Diagramme/Objektdiagramm Wordle Projekt.uxf b/Wordle Diagramme/Objektdiagramm Wordle Projekt.uxf index 2560294..c92c626 100644 --- a/Wordle Diagramme/Objektdiagramm Wordle Projekt.uxf +++ b/Wordle Diagramme/Objektdiagramm Wordle Projekt.uxf @@ -4,8 +4,8 @@ UMLClass - 114 - 582 + 294 + 366 270 96 @@ -27,8 +27,8 @@ UMLClass - 180 - 492 + 360 + 276 126 42 @@ -41,8 +41,8 @@ UMLClass - 0 - 786 + 180 + 570 126 42 @@ -54,8 +54,8 @@ UMLClass - 186 - 786 + 366 + 570 126 42 @@ -67,8 +67,8 @@ UMLClass - 180 - 390 + 360 + 174 126 42 @@ -80,8 +80,8 @@ UMLClass - 360 - 786 + 540 + 570 126 42 @@ -93,8 +93,8 @@ Relation - 240 - 528 + 420 + 312 18 66 @@ -104,8 +104,8 @@ Relation - 240 - 426 + 420 + 210 18 78 @@ -115,8 +115,8 @@ Relation - 240 - 750 + 420 + 534 18 48 @@ -126,8 +126,8 @@ Relation - 120 - 798 + 300 + 582 78 18 @@ -137,8 +137,8 @@ Relation - 306 - 798 + 486 + 582 66 18 @@ -148,8 +148,8 @@ UMLClass - 186 - 696 + 366 + 480 126 60 @@ -164,23 +164,26 @@ UMLClass - 462 - 570 + 642 + 354 126 - 120 + 156 object: User -- -+ final int connectionID -+ final String username -+ final String passwort -+ int timesPlayed -+ int winPercentage -+ int currentStreak -+ int maxStreak -+ int lastDayWOTDFinished -+ int state -+ int[] wonInTurn +- final int connectionID +- final String username +- final String password +- int timesPlayed +- int winPercentage +- int currentStreak +- int maxStreak +- int lastDayWOTDFinished +- int state +- int[] wonInTurn +-- ++ User(pConnectionID) ++getter & setter @@ -188,20 +191,20 @@ Relation - 378 - 618 + 558 + 408 96 24 lt=<.. -n - 140.0;20.0;10.0;20.0 +m1=n + 140.0;10.0;10.0;10.0 Relation - 240 - 672 + 420 + 456 24 36 @@ -214,8 +217,8 @@ n UMLClass - 684 - 606 + 864 + 390 126 54 @@ -230,12 +233,14 @@ String[] guesses Relation - 582 - 624 + 762 + 402 114 - 18 + 30 - lt=<.. - 170.0;10.0;10.0;10.0 + lt=<.. +m1=1 + + 170.0;20.0;10.0;20.0