|
发表于 2022-7-16 17:08:10
|
显示全部楼层
更好内插,部分代码
List<HullModButtonData> newButtonData = new ArrayList<>();
for (String id : Global.getSector().getPlayerFaction().getKnownHullMods()) {
if (selectedVariant.hasHullMod(id)) {
continue;
}
HullModSpecAPI hullMod = Global.getSettings().getHullModSpec(id);
if (hullMod.isHidden() || hullMod.isHiddenEverywhere()) {
continue;
}
int cost = SModUtils.getBuildInCost(hullMod, selectedVariant.getHullSize(), fleetMember.getDeploymentPointsCost());
newButtonData.add(
new HullModButtonData(
hullMod.getId(),
hullMod.getDisplayName(),
hullMod.getSpriteName(),
cost + " XP",
hullMod.getDescription(selectedVariant.getHullSize()), // 出错行
hullMod.getEffect(),
selectedVariant.getHullSize(),
cost)
);
}
|
|