From bafe745711e273c12c4742fd86d825f2eba6795c Mon Sep 17 00:00:00 2001 From: Alan19 Date: Sun, 16 Sep 2018 10:01:03 -0400 Subject: [PATCH] Code cleanup --- src/main/java/discord/TwoDee.java | 1 - src/main/java/logic/DiceRoller.java | 4 ++-- src/main/java/logic/StatisticsGenerator.java | 14 -------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/main/java/discord/TwoDee.java b/src/main/java/discord/TwoDee.java index 223d9d6..36034d9 100644 --- a/src/main/java/discord/TwoDee.java +++ b/src/main/java/discord/TwoDee.java @@ -3,7 +3,6 @@ import logic.CommandHandler; import org.javacord.api.DiscordApiBuilder; import org.javacord.api.entity.message.MessageBuilder; -import org.javacord.api.entity.user.User; import org.javacord.api.util.logging.ExceptionLogger; import java.io.BufferedReader; diff --git a/src/main/java/logic/DiceRoller.java b/src/main/java/logic/DiceRoller.java index 88e9427..a1cfcc8 100644 --- a/src/main/java/logic/DiceRoller.java +++ b/src/main/java/logic/DiceRoller.java @@ -62,7 +62,7 @@ private EmbedBuilder buildResultEmbed(MessageAuthor author, ArrayList d .setTitle(TwoDee.getRollTitleMessage()) .setAuthor(author) .setColor(new Color(random.nextFloat(), random.nextFloat(), random.nextFloat())) - .addField("Regular dice", formatResults(diceResults, author), true) + .addField("Regular dice", formatResults(diceResults), true) .addField("Picked", replaceBrackets(topTwo.toString()), true) .addField("Dropped", replaceBrackets(dropped.toString()), true) .addField("Plot dice", replaceBrackets(pdResults.toString()), true) @@ -70,7 +70,7 @@ private EmbedBuilder buildResultEmbed(MessageAuthor author, ArrayList d } //Bold 1s to show total doom generated. Runs doom increasing method afterwards. - private String formatResults(ArrayList s, MessageAuthor author) { + private String formatResults(ArrayList s) { String resultString = ""; if (s.size() > 1){ for (int i = 0; i < s.size() - 1; i++){ diff --git a/src/main/java/logic/StatisticsGenerator.java b/src/main/java/logic/StatisticsGenerator.java index d9c71f2..17e3159 100644 --- a/src/main/java/logic/StatisticsGenerator.java +++ b/src/main/java/logic/StatisticsGenerator.java @@ -46,20 +46,6 @@ public StatisticsGenerator(String message) { doomMap = generateProbabilityHash(diceList, plotDice, doomHash); } - private void addToPool(String argCopy, String numDice, ArrayList pool) { - //Remove all letters so only numbers remain to get the dice value - int diceVal = Integer.parseInt(argCopy.replaceAll("[a-zA-Z]", "")); - - //If there are multiple dice being rolled, add all of them to the pool. Otherwise, only add one. - if (numDice.equals("")) { - pool.add(diceVal); - } else { - for (int i = 0; i < Integer.parseInt(numDice); i++) { - pool.add(diceVal); - } - } - } - //Generate a HashMap with the roll as the keys and the percent as the values private HashMap generateProbabilityHash(ArrayList diceList, ArrayList plotDice, HashMap resultHash) { int totalCombos = getTotalCombos(diceList, plotDice);