npc/animals arrangement & support enter room scene

This commit is contained in:
Akka
2022-06-15 17:20:08 +08:00
committed by Melledy
parent e16633e34b
commit 7a247e70e0
9 changed files with 145 additions and 21 deletions

View File

@@ -16,13 +16,12 @@ import java.util.List;
@Builder(builderMethodName = "of")
@FieldDefaults(level = AccessLevel.PRIVATE)
public class HomeBlockItem {
@Id
int blockId;
boolean unlocked;
List<HomeFurnitureItem> deployFurnitureList;
List<HomeAnimalItem> deployAnimalList;
List<HomeNPCItem> deployNPCList;
public void update(HomeBlockArrangementInfo homeBlockArrangementInfo) {
this.blockId = homeBlockArrangementInfo.getBlockId();
@@ -30,6 +29,14 @@ public class HomeBlockItem {
this.deployFurnitureList = homeBlockArrangementInfo.getDeployFurniureListList().stream()
.map(HomeFurnitureItem::parseFrom)
.toList();
this.deployAnimalList = homeBlockArrangementInfo.getDeployAnimalListList().stream()
.map(HomeAnimalItem::parseFrom)
.toList();
this.deployNPCList = homeBlockArrangementInfo.getDeployNpcListList().stream()
.map(HomeNPCItem::parseFrom)
.toList();
}
public int calComfort(){
@@ -45,6 +52,8 @@ public class HomeBlockItem {
.setComfortValue(calComfort());
this.deployFurnitureList.forEach(f -> proto.addDeployFurniureList(f.toProto()));
this.deployAnimalList.forEach(f -> proto.addDeployAnimalList(f.toProto()));
this.deployNPCList.forEach(f -> proto.addDeployNpcList(f.toProto()));
return proto.build();
}
@@ -59,6 +68,8 @@ public class HomeBlockItem {
homeBlock.getFurnitures().stream()
.map(HomeFurnitureItem::parseFrom)
.toList())
.deployAnimalList(List.of())
.deployNPCList(List.of())
.build();
}
}