mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 19:04:40 +01:00
Levelup City Implementation (#2281)
* add statue promo data * implement levelup city feature * fix get level city when enter game * format code * fix typo, remove some property in the player, add the field cityInfoData to player class
This commit is contained in:
28
src/main/java/emu/grasscutter/game/city/CityInfoData.java
Normal file
28
src/main/java/emu/grasscutter/game/city/CityInfoData.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package emu.grasscutter.game.city;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.net.proto.CityInfoOuterClass.CityInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
public class CityInfoData {
|
||||
@Getter @Setter private int cityId;
|
||||
|
||||
@Getter @Setter
|
||||
private int level = 1; // level of the city (include level SotS, level Frostbearing Trees, etc.)
|
||||
|
||||
@Getter @Setter private int numCrystal = 0; // number of crystals in the city
|
||||
|
||||
public CityInfoData(int cityId) {
|
||||
this.cityId = cityId;
|
||||
}
|
||||
|
||||
public CityInfo toProto() {
|
||||
return CityInfo.newBuilder()
|
||||
.setCityId(cityId)
|
||||
.setLevel(level)
|
||||
.setCrystalNum(numCrystal)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user