[Editor] Enable basic serialization for object and image layers

The layers' properties are not serialized/deserialized yet. All the protos for object layer and image layer contains actually nothing except the layer name in Layer proto container.
This commit is contained in:
2021-02-17 14:37:10 +01:00
parent 78e11029e5
commit c76ad76d37
4 changed files with 47 additions and 2 deletions

View File

@@ -31,6 +31,10 @@ public class ProtobufMapDeserializer extends MapDeserializer {
private void deserializeLayer(GameMap map, GameMapProto.Layer proto) {
if (proto.hasTileLayer()) {
deserializeTileLayer(map, proto);
} else if (proto.hasObjectLayer()) {
deserializeObjectLayer(map, proto);
} else if (proto.hasImageLayer()) {
deserializeImageLayer(map, proto);
} else {
throw new AppException("Not supported layer type");
}
@@ -51,4 +55,12 @@ public class ProtobufMapDeserializer extends MapDeserializer {
}
}
}
private void deserializeObjectLayer(GameMap map, GameMapProto.Layer proto) {
var layer = map.createObjectLayer();
}
private void deserializeImageLayer(GameMap map, GameMapProto.Layer proto) {
// TODO(return new ImageLayer(...))
}
}