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:
@@ -0,0 +1,38 @@
|
||||
package network.protocol.packets;
|
||||
|
||||
import network.protocol.Packet;
|
||||
import network.protocol.PacketVisitor;
|
||||
import network.protocol.Packets;
|
||||
|
||||
public class ChangeCellPacket extends Packet {
|
||||
|
||||
static private final long serialVersionUID = Packets.ChangeCell.ordinal();
|
||||
|
||||
private final int sudokuIndex;
|
||||
private final int cellIndex;
|
||||
private final int newValue;
|
||||
|
||||
public ChangeCellPacket(int sudokuIndex, int cellIndex, int newValue) {
|
||||
this.sudokuIndex = sudokuIndex;
|
||||
this.cellIndex = cellIndex;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
|
||||
public int getSudokuIndex() {
|
||||
return sudokuIndex;
|
||||
}
|
||||
|
||||
public int getCellIndex() {
|
||||
return cellIndex;
|
||||
}
|
||||
|
||||
public int getNewValue() {
|
||||
return newValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(PacketVisitor packetVisitor) {
|
||||
packetVisitor.visitPacket(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package network.protocol.packets;
|
||||
|
||||
import network.protocol.Packet;
|
||||
import network.protocol.PacketVisitor;
|
||||
import network.protocol.Packets;
|
||||
|
||||
public class EndGamePacket extends Packet {
|
||||
|
||||
static private final long serialVersionUID = Packets.EndGame.ordinal();
|
||||
|
||||
private final int winnerId;
|
||||
|
||||
public EndGamePacket(int winnerId) {
|
||||
this.winnerId = winnerId;
|
||||
}
|
||||
|
||||
public int getWinnerId() {
|
||||
return winnerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(PacketVisitor packetVisitor) {
|
||||
packetVisitor.visitPacket(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package network.protocol.packets;
|
||||
|
||||
import network.protocol.Packet;
|
||||
import network.protocol.PacketVisitor;
|
||||
import network.protocol.Packets;
|
||||
|
||||
public class UpdatePlayerScorePacket extends Packet {
|
||||
|
||||
static private final long serialVersionUID = Packets.UpdatePlayerScore.ordinal();
|
||||
|
||||
private final int playerId;
|
||||
private final int cellsLeft;
|
||||
|
||||
public UpdatePlayerScorePacket(int playerId, int cellsLeft) {
|
||||
this.playerId = playerId;
|
||||
this.cellsLeft = cellsLeft;
|
||||
}
|
||||
|
||||
public int getPlayerId() {
|
||||
return playerId;
|
||||
}
|
||||
|
||||
public int getCellsLeft() {
|
||||
return cellsLeft;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(PacketVisitor packetVisitor) {
|
||||
packetVisitor.visitPacket(this);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user