mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 01:15:52 +01:00
Persist Tower Data && Set The Tower Schedule
This commit is contained in:
@@ -73,6 +73,7 @@ public class GameData {
|
||||
private static final Int2ObjectMap<RewardPreviewData> rewardPreviewDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<TowerFloorData> towerFloorDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<TowerLevelData> towerLevelDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<TowerScheduleData> towerScheduleDataMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
// Cache
|
||||
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
|
||||
@@ -327,4 +328,7 @@ public class GameData {
|
||||
public static Int2ObjectMap<TowerLevelData> getTowerLevelDataMap(){
|
||||
return towerLevelDataMap;
|
||||
}
|
||||
public static Int2ObjectMap<TowerScheduleData> getTowerScheduleDataMap(){
|
||||
return towerScheduleDataMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package emu.grasscutter.data.def;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ResourceType(name = "TowerScheduleExcelConfigData.json")
|
||||
public class TowerScheduleData extends GameResource {
|
||||
private int ScheduleId;
|
||||
private List<Integer> EntranceFloorId;
|
||||
private List<ScheduleDetail> Schedules;
|
||||
private int MonthlyLevelConfigId;
|
||||
@Override
|
||||
public int getId() {
|
||||
return ScheduleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
this.Schedules = this.Schedules.stream()
|
||||
.filter(item -> item.getFloorList().size() > 0)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public int getScheduleId() {
|
||||
return ScheduleId;
|
||||
}
|
||||
|
||||
public void setScheduleId(int scheduleId) {
|
||||
ScheduleId = scheduleId;
|
||||
}
|
||||
|
||||
public List<Integer> getEntranceFloorId() {
|
||||
return EntranceFloorId;
|
||||
}
|
||||
|
||||
public void setEntranceFloorId(List<Integer> entranceFloorId) {
|
||||
EntranceFloorId = entranceFloorId;
|
||||
}
|
||||
|
||||
public List<ScheduleDetail> getSchedules() {
|
||||
return Schedules;
|
||||
}
|
||||
|
||||
public void setSchedules(List<ScheduleDetail> schedules) {
|
||||
Schedules = schedules;
|
||||
}
|
||||
|
||||
public int getMonthlyLevelConfigId() {
|
||||
return MonthlyLevelConfigId;
|
||||
}
|
||||
|
||||
public void setMonthlyLevelConfigId(int monthlyLevelConfigId) {
|
||||
MonthlyLevelConfigId = monthlyLevelConfigId;
|
||||
}
|
||||
|
||||
public static class ScheduleDetail{
|
||||
private List<Integer> FloorList;
|
||||
|
||||
public List<Integer> getFloorList() {
|
||||
return FloorList;
|
||||
}
|
||||
|
||||
public void setFloorList(List<Integer> floorList) {
|
||||
FloorList = floorList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user