forked from IF-LK-2020/wordle
finished END_PHASE
This commit is contained in:
@@ -14,15 +14,15 @@ public class User {
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
Game.databaseConnector.executeStatement("UPDATE User SET password = " + password + " Where name = " + this.name);
|
||||
Game.databaseConnector.executeStatement("UPDATE User SET password = " + password + " Where name = " + this.name);
|
||||
}
|
||||
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT password FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return result;
|
||||
Game.databaseConnector.executeStatement("SELECT password FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class User {
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ public class User {
|
||||
public float getWinPercentage()
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT winPercentage FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Float.parseFloat(result);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Float.parseFloat(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ public class User {
|
||||
public int getTimesPlayed()
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT timesPlayed FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,8 @@ public class User {
|
||||
public int getCurrentStreak()
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT currentStreak FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@ public class User {
|
||||
public int getMaxStreak()
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT maxStreak FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,8 +133,8 @@ public class User {
|
||||
public int getWonInTurn(int row)
|
||||
{
|
||||
Game.databaseConnector.executeStatement("SELECT wonInTurn" + row + " FROM User Where name =" + this.name);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
String result = Game.databaseConnector.getCurrentQueryResult().getData()[0][0];
|
||||
return Integer.parseInt(result);
|
||||
}
|
||||
|
||||
public void increaseWonInTurn(int row)
|
||||
@@ -145,8 +145,8 @@ public class User {
|
||||
|
||||
public int[] getWonInTurnFull()
|
||||
{
|
||||
int[] result = {getWonInTurn(1),getWonInTurn(2),getWonInTurn(3),getWonInTurn(4),getWonInTurn(5),getWonInTurn(6)};
|
||||
return result;
|
||||
int[] result = {getWonInTurn(1),getWonInTurn(2),getWonInTurn(3),getWonInTurn(4),getWonInTurn(5),getWonInTurn(6)};
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user