[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:
@@ -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(...))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user