Methodenköpfe für Query und User; Objektdiagram überarbeitet

This commit is contained in:
Artem Didytschuk 2022-03-01 11:30:07 +01:00
parent d34ce44ae8
commit 7cecb26a5a
6 changed files with 182 additions and 52 deletions

7
.gitignore vendored
View File

@ -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

22
Query.java Normal file
View File

@ -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 "";
}
}

View File

@ -19,7 +19,7 @@ public class Queue<ContentType> {
/* --------- Anfang der privaten inneren Klasse -------------- */
private class QueueNode {
public class QueueNode {
private ContentType content = null;
private QueueNode nextNode = null;

View File

@ -30,7 +30,7 @@ public abstract class Server
private NewConnectionHandler connectionHandler;
private List<ClientMessageHandler> messageHandlers;
private class NewConnectionHandler extends Thread
public class NewConnectionHandler extends Thread
{
private ServerSocket serverSocket;
private boolean active;

96
User.java Normal file
View File

@ -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;
}
}

View File

@ -4,8 +4,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>114</x>
<y>582</y>
<x>294</x>
<y>366</y>
<w>270</w>
<h>96</h>
</coordinates>
@ -27,8 +27,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>180</x>
<y>492</y>
<x>360</x>
<y>276</y>
<w>126</w>
<h>42</h>
</coordinates>
@ -41,8 +41,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>0</x>
<y>786</y>
<x>180</x>
<y>570</y>
<w>126</w>
<h>42</h>
</coordinates>
@ -54,8 +54,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>186</x>
<y>786</y>
<x>366</x>
<y>570</y>
<w>126</w>
<h>42</h>
</coordinates>
@ -67,8 +67,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>180</x>
<y>390</y>
<x>360</x>
<y>174</y>
<w>126</w>
<h>42</h>
</coordinates>
@ -80,8 +80,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>360</x>
<y>786</y>
<x>540</x>
<y>570</y>
<w>126</w>
<h>42</h>
</coordinates>
@ -93,8 +93,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>240</x>
<y>528</y>
<x>420</x>
<y>312</y>
<w>18</w>
<h>66</h>
</coordinates>
@ -104,8 +104,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>240</x>
<y>426</y>
<x>420</x>
<y>210</y>
<w>18</w>
<h>78</h>
</coordinates>
@ -115,8 +115,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>240</x>
<y>750</y>
<x>420</x>
<y>534</y>
<w>18</w>
<h>48</h>
</coordinates>
@ -126,8 +126,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>120</x>
<y>798</y>
<x>300</x>
<y>582</y>
<w>78</w>
<h>18</h>
</coordinates>
@ -137,8 +137,8 @@
<element>
<id>Relation</id>
<coordinates>
<x>306</x>
<y>798</y>
<x>486</x>
<y>582</y>
<w>66</w>
<h>18</h>
</coordinates>
@ -148,8 +148,8 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>186</x>
<y>696</y>
<x>366</x>
<y>480</y>
<w>126</w>
<h>60</h>
</coordinates>
@ -164,23 +164,26 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>462</x>
<y>570</y>
<x>642</x>
<y>354</y>
<w>126</w>
<h>120</h>
<h>156</h>
</coordinates>
<panel_attributes>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 &amp; setter
</panel_attributes>
<additional_attributes/>
@ -188,20 +191,20 @@
<element>
<id>Relation</id>
<coordinates>
<x>378</x>
<y>618</y>
<x>558</x>
<y>408</y>
<w>96</w>
<h>24</h>
</coordinates>
<panel_attributes>lt=&lt;..
n</panel_attributes>
<additional_attributes>140.0;20.0;10.0;20.0</additional_attributes>
m1=n</panel_attributes>
<additional_attributes>140.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>240</x>
<y>672</y>
<x>420</x>
<y>456</y>
<w>24</w>
<h>36</h>
</coordinates>
@ -214,8 +217,8 @@ n</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>684</x>
<y>606</y>
<x>864</x>
<y>390</y>
<w>126</w>
<h>54</h>
</coordinates>
@ -230,12 +233,14 @@ String[] guesses
<element>
<id>Relation</id>
<coordinates>
<x>582</x>
<y>624</y>
<x>762</x>
<y>402</y>
<w>114</w>
<h>18</h>
<h>30</h>
</coordinates>
<panel_attributes>lt=&lt;..</panel_attributes>
<additional_attributes>170.0;10.0;10.0;10.0</additional_attributes>
<panel_attributes>lt=&lt;..
m1=1
</panel_attributes>
<additional_attributes>170.0;20.0;10.0;20.0</additional_attributes>
</element>
</diagram>