fix: fixed proper serialization of MoveEvents
This commit is contained in:
parent
e0258b5dc8
commit
4354adda2a
@ -97,10 +97,15 @@ public class EventSerializer extends StdSerializer<Event> {
|
|||||||
SerializerProvider provider)
|
SerializerProvider provider)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
gen.writeObjectField("originEntity", value.originEntity);
|
gen.writeObjectField("originEntity", value.originEntity);
|
||||||
gen.writeObjectField("targetEntity", value.targetEntity);
|
|
||||||
|
if (value.type != EventType.MoveEvent) {
|
||||||
|
gen.writeObjectField("targetEntity", value.targetEntity);
|
||||||
|
}
|
||||||
|
|
||||||
gen.writeObjectField("originField", value.originField);
|
gen.writeObjectField("originField", value.originField);
|
||||||
gen.writeObjectField("targetField", value.targetField);
|
gen.writeObjectField("targetField", value.targetField);
|
||||||
|
|
||||||
|
|
||||||
if (value.type == EventType.UseInfinityStoneEvent || value.type == EventType.ExchangeInfinityStoneEvent) {
|
if (value.type == EventType.UseInfinityStoneEvent || value.type == EventType.ExchangeInfinityStoneEvent) {
|
||||||
gen.writeObjectField("stoneType", new EntityID(EntityType.InfinityStones, value.stoneType.getID()));
|
gen.writeObjectField("stoneType", new EntityID(EntityType.InfinityStones, value.stoneType.getID()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user