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)
|
||||
throws IOException {
|
||||
gen.writeObjectField("originEntity", value.originEntity);
|
||||
|
||||
if (value.type != EventType.MoveEvent) {
|
||||
gen.writeObjectField("targetEntity", value.targetEntity);
|
||||
}
|
||||
|
||||
gen.writeObjectField("originField", value.originField);
|
||||
gen.writeObjectField("targetField", value.targetField);
|
||||
|
||||
|
||||
if (value.type == EventType.UseInfinityStoneEvent || value.type == EventType.ExchangeInfinityStoneEvent) {
|
||||
gen.writeObjectField("stoneType", new EntityID(EntityType.InfinityStones, value.stoneType.getID()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user