minas please help no serialization
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import com.jme3.network.*;
|
import com.jme3.network.*;
|
||||||
import com.jme3.network.serializing.Serializer;
|
import com.jme3.network.serializing.Serializer;
|
||||||
|
import com.jme3.network.serializing.serializers.EnumSerializer;
|
||||||
import pp.mdga.game.*;
|
import pp.mdga.game.*;
|
||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.message.server.*;
|
import pp.mdga.message.server.*;
|
||||||
@@ -12,7 +13,6 @@
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.System.Logger;
|
import java.lang.System.Logger;
|
||||||
import java.lang.System.Logger.Level;
|
import java.lang.System.Logger.Level;
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
@@ -143,6 +143,8 @@ private void initializeSerializables() {
|
|||||||
Serializer.registerClass(StartNode.class);
|
Serializer.registerClass(StartNode.class);
|
||||||
Serializer.registerClass(PlayerData.class);
|
Serializer.registerClass(PlayerData.class);
|
||||||
Serializer.registerClass(HomeNode.class);
|
Serializer.registerClass(HomeNode.class);
|
||||||
|
Serializer.registerClass(PieceState.class, new EnumSerializer());
|
||||||
|
Serializer.registerClass(ShieldState.class, new EnumSerializer());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerListeners() {
|
private void registerListeners() {
|
||||||
|
|||||||
@@ -19,5 +19,9 @@ public enum PieceState {
|
|||||||
/**
|
/**
|
||||||
* The piece is finished.
|
* The piece is finished.
|
||||||
*/
|
*/
|
||||||
HOMEFINISHED
|
HOMEFINISHED;
|
||||||
|
|
||||||
|
public PieceState next() {
|
||||||
|
return values()[(ordinal() + 1) % values().length];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,10 @@ public enum ShieldState {
|
|||||||
/**
|
/**
|
||||||
* The shield is suppressed, when the piece is on a start node.
|
* The shield is suppressed, when the piece is on a start node.
|
||||||
*/
|
*/
|
||||||
SUPPRESSED
|
SUPPRESSED;
|
||||||
|
|
||||||
|
|
||||||
|
public ShieldState next() {
|
||||||
|
return values()[(ordinal() + 1) % values().length];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user