Fix serialisation issue
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import com.jme3.network.*;
|
||||
import com.jme3.network.serializing.Serializer;
|
||||
import com.jme3.network.serializing.serializers.EnumSerializer;
|
||||
import pp.mdga.Resources;
|
||||
import pp.mdga.game.*;
|
||||
import pp.mdga.message.client.*;
|
||||
@@ -145,6 +146,10 @@ private void initializeSerializables() {
|
||||
Serializer.registerClass(StartNode.class);
|
||||
Serializer.registerClass(PlayerData.class);
|
||||
Serializer.registerClass(HomeNode.class);
|
||||
|
||||
Serializer.registerClass(Color.class, new EnumSerializer());
|
||||
Serializer.registerClass(PieceState.class, new EnumSerializer());
|
||||
Serializer.registerClass(ShieldState.class, new EnumSerializer());
|
||||
}
|
||||
|
||||
private void registerListeners() {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
import com.jme3.network.serializing.Serializable;
|
||||
|
||||
/**
|
||||
* This enumeration will be used to show the four different TSK which can be picked from a player.
|
||||
* In Addition, the NONE color will be used to show a none color.
|
||||
*/
|
||||
@Serializable
|
||||
public enum Color {
|
||||
/**
|
||||
* Represents the air force color.
|
||||
|
||||
@@ -10,7 +10,7 @@ public class Node {
|
||||
protected Piece occupant;
|
||||
|
||||
public Node(){
|
||||
|
||||
occupant = new Piece(Color.AIRFORCE, PieceState.WAITING);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
import com.jme3.network.serializing.Serializable;
|
||||
|
||||
/**
|
||||
* Represents the state of a piece.
|
||||
*/
|
||||
@Serializable
|
||||
public enum PieceState {
|
||||
/**
|
||||
* The piece is active.
|
||||
|
||||
Reference in New Issue
Block a user