[Proto] Apply the Entity/Character changes

This commit is contained in:
2022-08-22 23:47:49 +02:00
parent f7fa76036b
commit 33dad1e6d3
4 changed files with 8 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ class ProtobufProjectDeserializer : ProjectDeserializer {
maps.addAll(proto.mapsList.map { deserializeMap(this, it) })
tileSets.addAll(proto.tileSetsList.map { deserializeTileSet(this, it) })
images.addAll(proto.imagesList.map { deserializeImage(this, it) })
characterSets.addAll(proto.entitySetsList.map { deserializeCharacterSet(this, it) })
characterSets.addAll(proto.characterSetsList.map { deserializeCharacterSet(this, it) })
animations.addAll(proto.animationsList.map { deserializeAnimation(this, it) })
iconSets.addAll(proto.iconSetsList.map { deserializeIconSet(this, it) })
fonts.addAll(proto.fontsList.map { deserializeFont(this, it) })
@@ -57,7 +57,7 @@ class ProtobufProjectDeserializer : ProjectDeserializer {
name = image.name
)
private fun deserializeCharacterSet(project: Project, characterSetAsset: ProjectProto.EntitySetAsset) = CharacterSet(
private fun deserializeCharacterSet(project: Project, characterSetAsset: ProjectProto.CharacterSetAsset) = CharacterSet(
project = project,
uid = characterSetAsset.uid,
source = characterSetAsset.source,

View File

@@ -24,7 +24,7 @@ class ProtobufProjectSerializer : ProjectSerializer {
proto.addAllMaps(item.maps.map(this::serializeMap))
proto.addAllTileSets(item.tileSets.map(this::serializeTileSet))
proto.addAllImages(item.images.map(this::serializeImage))
proto.addAllEntitySets(item.characterSets.map(this::serializeCharacterSet))
proto.addAllCharacterSets(item.characterSets.map(this::serializeCharacterSet))
proto.addAllAnimations(item.animations.map(this::serializeAnimation))
proto.addAllIconSets(item.iconSets.map(this::serializeIconSet))
proto.addAllFonts(item.fonts.map(this::serializeFont))
@@ -53,7 +53,7 @@ class ProtobufProjectSerializer : ProjectSerializer {
.setName(image.name)
.build()
private fun serializeCharacterSet(characterSet: CharacterSet) = ProjectProto.EntitySetAsset.newBuilder()
private fun serializeCharacterSet(characterSet: CharacterSet) = ProjectProto.CharacterSetAsset.newBuilder()
.setUid(characterSet.uid)
.setSource(characterSet.source)
.setName(characterSet.name)

View File

@@ -29,7 +29,7 @@ public class ProtobufProjectDeserializer extends ProjectDeserializer {
.tileSetAssets(proto.getTileSetsList().stream().map(this::parseTileSetAsset).collect(toList()))
.mapAssets(proto.getMapsList().stream().map(this::parseGameMapAsset).collect(toList()))
.imageAssets(proto.getImagesList().stream().map(this::parseImageAsset).collect(toList()))
.characterSetAssets(proto.getEntitySetsList().stream().map(this::parseEntitySetAsset).collect(toList()))
.characterSetAssets(proto.getCharacterSetsList().stream().map(this::parseCharacterSetAsset).collect(toList()))
.animationAssets(proto.getAnimationsList().stream().map(this::parseAnimationAsset).collect(toList()))
.fontAssets(proto.getFontsList().stream().map(this::parseFontAsset).collect(toList()))
.widgetDefinitionAssets(proto.getWidgetsList().stream().map(this::parseWidgetAsset).collect(toList()))
@@ -49,7 +49,7 @@ public class ProtobufProjectDeserializer extends ProjectDeserializer {
return new ImageAsset(proto.getUid(), proto.getSource());
}
private CharacterSetAsset parseEntitySetAsset(ProjectProto.EntitySetAsset proto) {
private CharacterSetAsset parseCharacterSetAsset(ProjectProto.CharacterSetAsset proto) {
return new CharacterSetAsset(proto.getUid(), proto.getSource(), proto.getRows(), proto.getColumns());
}

View File

@@ -9,7 +9,7 @@ message Project {
repeated GameMapAsset maps = 3;
repeated TileSetAsset tileSets = 4;
repeated ImageAsset images = 5;
repeated EntitySetAsset entitySets = 6;
repeated CharacterSetAsset characterSets = 6;
repeated FontAsset fonts = 7;
repeated WidgetAsset widgets = 8;
repeated AnimationAsset animations = 9;
@@ -37,7 +37,7 @@ message ImageAsset {
required string name = 3;
}
message EntitySetAsset {
message CharacterSetAsset {
required string uid = 1;
required string source = 2;
required string name = 3;