This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
package gui.menu;
|
||||
|
||||
import game.Player;
|
||||
import imgui.ImGui;
|
||||
import network.client.Client;
|
||||
import network.server.Server;
|
||||
|
||||
public class MultiPlayerView extends BaseView {
|
||||
|
||||
private final Client client;
|
||||
|
||||
public MultiPlayerView(StateMachine stateMachine, Client client) {
|
||||
private final Client client;
|
||||
private final Server server;
|
||||
|
||||
public MultiPlayerView(StateMachine stateMachine, Client client, Server server) {
|
||||
super(stateMachine);
|
||||
this.client = client;
|
||||
this.server = server;
|
||||
this.client.onDisconnect.connect(this::onDisconnect);
|
||||
}
|
||||
|
||||
@@ -23,9 +27,25 @@ public class MultiPlayerView extends BaseView {
|
||||
this.stateMachine.popState();
|
||||
}
|
||||
|
||||
public void renderGameStatus() {
|
||||
if (this.server == null) {
|
||||
ImGui.text("En attente de l'administrateur du serveur ...");
|
||||
} else {
|
||||
if (ImGui.button("Démarrer")) {
|
||||
// start the game
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
ImGui.text("Tema le gameplay");
|
||||
ImGui.text("Joueurs :");
|
||||
{
|
||||
for (Player player : this.client.getGame().getPlayers().values()) {
|
||||
ImGui.bulletText(player.getPseudo());
|
||||
}
|
||||
}
|
||||
renderGameStatus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user