feat: multi synced player scores
All checks were successful
Linux arm64 / Build (push) Successful in 31s
All checks were successful
Linux arm64 / Build (push) Successful in 31s
This commit is contained in:
@@ -4,6 +4,7 @@ import gui.SudokuRenderer;
|
||||
import imgui.ImGui;
|
||||
import network.client.Client;
|
||||
import network.server.Server;
|
||||
import sudoku.structure.Cell;
|
||||
|
||||
public class MultiPlayerDokuView extends BaseView{
|
||||
|
||||
@@ -16,9 +17,14 @@ public class MultiPlayerDokuView extends BaseView{
|
||||
this.client = client;
|
||||
this.server = server;
|
||||
this.sudokuRenderer = new SudokuRenderer(this.client.getGame().getDoku());
|
||||
this.sudokuRenderer.onCellChange.connect(this::onCellChange);
|
||||
this.client.onDisconnect.connect(this::onDisconnect);
|
||||
}
|
||||
|
||||
private void onCellChange(Cell cell) {
|
||||
this.client.sendCellChange(cell);
|
||||
}
|
||||
|
||||
public void onDisconnect() {
|
||||
if (server == null) {
|
||||
closeMenu();
|
||||
|
||||
Reference in New Issue
Block a user