This commit is contained in:
@@ -6,6 +6,7 @@ import network.protocol.packets.KeepAlivePacket;
|
||||
import network.protocol.packets.LoginPacket;
|
||||
import network.protocol.packets.PlayerJoinPacket;
|
||||
import network.protocol.packets.PlayerLeavePacket;
|
||||
import network.protocol.packets.StartGamePacket;
|
||||
|
||||
public interface PacketVisitor {
|
||||
|
||||
@@ -19,5 +20,6 @@ public interface PacketVisitor {
|
||||
void visitPacket(LoginPacket packet);
|
||||
void visitPacket(PlayerJoinPacket packet);
|
||||
void visitPacket(PlayerLeavePacket packet);
|
||||
void visitPacket(StartGamePacket packet);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package network.protocol;
|
||||
|
||||
public enum Packets {
|
||||
|
||||
ConnectionInfo, KeepAlive, Disconnect, Login, PlayerJoin, PlayerLeave
|
||||
ConnectionInfo, KeepAlive, Disconnect, Login, PlayerJoin, PlayerLeave, StartGame
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package network.protocol.packets;
|
||||
|
||||
import network.protocol.Packet;
|
||||
import network.protocol.PacketVisitor;
|
||||
import network.protocol.Packets;
|
||||
|
||||
public class StartGamePacket extends Packet {
|
||||
|
||||
static private final long serialVersionUID = Packets.StartGame.ordinal();
|
||||
|
||||
private final String serializedSudoku;
|
||||
|
||||
public StartGamePacket(String serializedSudoku) {
|
||||
this.serializedSudoku = serializedSudoku;
|
||||
}
|
||||
|
||||
public String getSerializedSudoku() {
|
||||
return serializedSudoku;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(PacketVisitor packetVisitor) {
|
||||
packetVisitor.visitPacket(this);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user