feat: make timer stop game (Fixes #15)
All checks were successful
Linux arm64 / Build (push) Successful in 29s
All checks were successful
Linux arm64 / Build (push) Successful in 29s
This commit is contained in:
@@ -4,6 +4,7 @@ import java.io.IOException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Random;
|
||||
|
||||
import common.ConsumerSignal;
|
||||
import common.Signal;
|
||||
import game.Game;
|
||||
import game.Player;
|
||||
@@ -21,6 +22,7 @@ public class Client {
|
||||
public final Signal onDisconnect = new Signal();
|
||||
public final Signal onClosed = new Signal();
|
||||
public final Signal onGameStarted = new Signal();
|
||||
public final ConsumerSignal<Player> onGameEnd = new ConsumerSignal<>();
|
||||
|
||||
Player player;
|
||||
|
||||
|
||||
@@ -78,8 +78,9 @@ public class ClientConnexion extends Connexion {
|
||||
|
||||
@Override
|
||||
public void visitPacket(EndGamePacket packet) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
|
||||
Player winner = this.client.getGame().getLeaderboard().getFirst();
|
||||
this.client.getGame().stopGame();
|
||||
this.client.onGameEnd.emit(winner);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user