diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-07-30 23:25:19 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-07-30 23:25:19 +0200 |
commit | 90a50709bfac7978fba696814833d3e4859c4a1c (patch) | |
tree | 919f0ac43e2c9fa60288d4ef4421509a39cbc978 /src/main/java/io | |
parent | e87b4757a510bd95c4f565e020d2516bcaf1c467 (diff) | |
download | NotEnoughUpdates-90a50709bfac7978fba696814833d3e4859c4a1c.tar.gz NotEnoughUpdates-90a50709bfac7978fba696814833d3e4859c4a1c.tar.bz2 NotEnoughUpdates-90a50709bfac7978fba696814833d3e4859c4a1c.zip |
code cleanup
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java index 0e70f8cb..6af7af32 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java @@ -111,14 +111,43 @@ public class MinionHelperManager { minions.put(internalName, new Minion(internalName, tier)); } - public Map<String, Minion> getAllMinions() { - return minions; - } - public String formatInternalName(String text) { return text.toUpperCase().replace(" ", "_"); } + public List<Minion> getChildren(Minion minion) { + List<Minion> list = new ArrayList<>(); + for (Minion other : minions.values()) { + if (minion == other.getParent()) { + list.add(other); + list.addAll(getChildren(other)); + break; + } + } + return list; + } + + public void onProfileSwitch() { + //TODO check if the feature is enabled + for (Minion minion : minions.values()) { + minion.setCrafted(false); + minion.setMeetRequirements(false); + } + + api.onProfileSwitch(); + } + + public void reloadData() { + requirementsManager.reloadRequirements(); + + ApiData apiData = api.getApiData(); + if (apiData != null) { + for (String minion : apiData.getCraftedMinions()) { + getMinionById(minion).setCrafted(true); + } + } + } + public void handleCommand(String[] args) { if (args.length == 2) { String parameter = args[1]; @@ -154,43 +183,10 @@ public class MinionHelperManager { Utils.addChatMessage(""); } - public List<Minion> getChildren(Minion minion) { - List<Minion> list = new ArrayList<>(); - for (Minion other : minions.values()) { - if (minion == other.getParent()) { - list.add(other); - list.addAll(getChildren(other)); - break; - } - } - return list; - } - - public void onProfileSwitch() { - //TODO check if the feature is enabled - for (Minion minion : minions.values()) { - minion.setCrafted(false); - minion.setMeetRequirements(false); - } - - api.onProfileSwitch(); - } - public MinionHelperPriceCalculation getPriceCalculation() { return priceCalculation; } - public void reloadData() { - requirementsManager.reloadRequirements(); - - ApiData apiData = api.getApiData(); - if (apiData != null) { - for (String minion : apiData.getCraftedMinions()) { - getMinionById(minion).setCrafted(true); - } - } - } - public MinionHelperRequirementsManager getRequirementsManager() { return requirementsManager; } @@ -206,4 +202,8 @@ public class MinionHelperManager { public MinionHelperOverlay getOverlay() { return overlay; } + + public Map<String, Minion> getAllMinions() { + return minions; + } } |