From 580d851b50fc62762d7e1e31949298f27d90a99a Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sat, 30 Jul 2022 23:28:57 +0200 Subject: code cleanup --- .../minionhelper/loaders/repo/MinionHelperRepoLoader.java | 5 ++--- .../miscgui/minionhelper/sources/CustomSource.java | 11 +++++------ .../minionhelper/util/MinionHelperPriceCalculation.java | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/repo/MinionHelperRepoLoader.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/repo/MinionHelperRepoLoader.java index e81a0f29..5e96f377 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/repo/MinionHelperRepoLoader.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/repo/MinionHelperRepoLoader.java @@ -78,7 +78,6 @@ public class MinionHelperRepoLoader { } void load() { - //TODO load new from config entries and so? errorWhileLoading = false; createMinions(); @@ -111,10 +110,10 @@ public class MinionHelperRepoLoader { for (Map.Entry entry : customSource.entrySet()) { String internalName = entry.getKey(); - String description = entry.getValue(); + String sourceName = entry.getValue(); Minion minion = manager.getMinionById(internalName); if (minion == null) continue; - minion.setMinionSource(new CustomSource(minion, description)); + minion.setMinionSource(new CustomSource(minion, sourceName)); } manager.getMinionById("FLOWER_GENERATOR_1").getRequirements().add(new CustomRequirement( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/sources/CustomSource.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/sources/CustomSource.java index ccbd84fb..45a8bf08 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/sources/CustomSource.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/sources/CustomSource.java @@ -23,15 +23,14 @@ import io.github.moulberry.notenoughupdates.miscgui.minionhelper.Minion; public class CustomSource extends MinionSource { - //TODO rename variable - private final String customSource; + private final String sourceName; - public CustomSource(Minion minion, String customSource) { + public CustomSource(Minion minion, String sourceName) { super(minion); - this.customSource = customSource; + this.sourceName = sourceName; } - public String getCustomSource() { - return customSource; + public String getSourceName() { + return sourceName; } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperPriceCalculation.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperPriceCalculation.java index 32131251..f1a92b57 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperPriceCalculation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperPriceCalculation.java @@ -77,7 +77,7 @@ public class MinionHelperPriceCalculation { } if (source instanceof CustomSource) { - return "§f" + ((CustomSource) source).getCustomSource(); + return "§f" + ((CustomSource) source).getSourceName(); } long costs = calculateUpgradeCosts(source, upgradeOnly); -- cgit