phase constants

This commit is contained in:
Asecave 2022-03-07 15:50:37 +01:00
parent 86d449cba2
commit e203a8747c
1 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,9 @@
public class Game { public class Game {
// Instanzvariablen - ersetzen Sie das folgende Beispiel mit Ihren Variablen
private static final int LOGIN_PHASE = 0;
private static final int GAME_PHASE = 1;
private static final int END_PHASE = 2;
WordleServer wordleServer; WordleServer wordleServer;
User user; User user;
static DatabaseConnector databaseConnector;// Datenbankverbindung aufstellen static DatabaseConnector databaseConnector;// Datenbankverbindung aufstellen
@ -31,7 +35,6 @@ public class Game {
this.port = pClientPort; this.port = pClientPort;
send("+OK Hello there"); send("+OK Hello there");
} }
public void processMessage(String msg) { public void processMessage(String msg) {
@ -45,13 +48,13 @@ public class Game {
} }
switch (phase) { switch (phase) {
case 0: case LOGIN_PHASE:
loginPhase(msg); loginPhase(msg);
break; break;
case 1: case GAME_PHASE:
gamePhase(msg); gamePhase(msg);
break; break;
case 2: case END_PHASE:
endPhase(msg); endPhase(msg);
break; break;
} }