From 174c38887e2f1a958b010bf94895930fbe7c18e1 Mon Sep 17 00:00:00 2001 From: Matthew Cech Date: Wed, 19 Jun 2019 22:35:11 -0700 Subject: [PATCH] = Updated command formatting --- src/commands/CommandBlurry.java | 4 ++-- src/commands/CommandBoop.java | 12 ++++++------ src/commands/CommandHelpBuilder.java | 8 ++++---- src/commands/CommandMap.java | 10 +++++----- src/commands/CommandPerish.java | 4 ++-- src/commands/CommandShutdown.java | 2 -- src/commands/CommandStark.java | 4 ++-- 7 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/commands/CommandBlurry.java b/src/commands/CommandBlurry.java index c2a834b..221cc80 100644 --- a/src/commands/CommandBlurry.java +++ b/src/commands/CommandBlurry.java @@ -53,7 +53,7 @@ public class CommandBlurry extends Command return; } preProcessed = new File(filename); - ApplySnap(ImageIO.read(preProcessed), name); + applySnap(ImageIO.read(preProcessed), name); } catch (IOException e) { @@ -67,7 +67,7 @@ public class CommandBlurry extends Command ImageUtils.blockingFileDelete(postProcessed); } - private static void ApplySnap(BufferedImage image, String name) throws IOException + private static void applySnap(BufferedImage image, String name) throws IOException { BufferedImage blurred = ImageUtils.copyImage(image); // Iterate over each column left to right and touch up each pixel diff --git a/src/commands/CommandBoop.java b/src/commands/CommandBoop.java index d694277..fc4a1c3 100644 --- a/src/commands/CommandBoop.java +++ b/src/commands/CommandBoop.java @@ -19,13 +19,13 @@ public class CommandBoop extends Command public BoopTracker() { super("booptracker"); } - public void ApplyBoop() + public void applyBoop() { ++boops; markDirty(); } - public int HowMany() + public int howMany() { return boops; } @@ -68,14 +68,14 @@ public class CommandBoop extends Command { if(input.mentions == null) { - boopTracker.ApplyBoop(); - res.send(String.format(LocStrings.stub("BoopStandard"), user.name, boopTracker.HowMany())); + boopTracker.applyBoop(); + res.send(String.format(LocStrings.stub("BoopStandard"), user.name, boopTracker.howMany())); } else { if(input.mentions.length == 1) { - boopTracker.ApplyBoop(); + boopTracker.applyBoop(); res.send(String.format(LocStrings.stub("BoopPerson"), user.name, input.mentions[0].name)); return; } @@ -83,7 +83,7 @@ public class CommandBoop extends Command String booped = ""; for(int i = 0; i < input.mentions.length; i++) { - boopTracker.ApplyBoop(); + boopTracker.applyBoop(); if(i < input.mentions.length-1) booped += input.mentions[i].name + ", "; else diff --git a/src/commands/CommandHelpBuilder.java b/src/commands/CommandHelpBuilder.java index 109dc03..85c46f5 100644 --- a/src/commands/CommandHelpBuilder.java +++ b/src/commands/CommandHelpBuilder.java @@ -48,9 +48,9 @@ public class CommandHelpBuilder extends Command { // Format outstring and send it back for now String out = ""; - out += PopulateSection(KittyRole.Admin, commandsByRole, true) + "\n"; - out += PopulateSection(KittyRole.Mod, commandsByRole, true) + "\n"; - out += PopulateSection(KittyRole.General, commandsByRole, false) + "\n"; + out += populateSection(KittyRole.Admin, commandsByRole, true) + "\n"; + out += populateSection(KittyRole.Mod, commandsByRole, true) + "\n"; + out += populateSection(KittyRole.General, commandsByRole, false) + "\n"; // Write out file String filename = "buildhelp_out.txt"; @@ -73,7 +73,7 @@ public class CommandHelpBuilder extends Command { } // Generates the section for a specific role, optionally adding spacing after for another section - private String PopulateSection(KittyRole role, HashMap> commandsByRole, boolean delimitSection) + private String populateSection(KittyRole role, HashMap> commandsByRole, boolean delimitSection) { // Formatting variables final String headerStart = "

"; diff --git a/src/commands/CommandMap.java b/src/commands/CommandMap.java index f607229..0edf9de 100644 --- a/src/commands/CommandMap.java +++ b/src/commands/CommandMap.java @@ -52,11 +52,11 @@ public class CommandMap extends Command String widthStr = parser.getOption("-w", true); if(widthStr != null) - width = ValidateSize(Integer.parseInt(widthStr), MaxWidth); + width = validateSize(Integer.parseInt(widthStr), MaxWidth); String heightStr = parser.getOption("-h", true); if(heightStr != null) - height = ValidateSize(Integer.parseInt(heightStr), MaxHeight); + height = validateSize(Integer.parseInt(heightStr), MaxHeight); } catch(NumberFormatException e) { @@ -83,7 +83,7 @@ public class CommandMap extends Command // Response body creation body += "```\n"; - body += GenerateMap(width, height, randGenerator); + body += generateMap(width, height, randGenerator); body += "\n```"; // Send back the map @@ -91,7 +91,7 @@ public class CommandMap extends Command } // Verifies and appropriately caps input as necessary - int ValidateSize(int input, int max) + int validateSize(int input, int max) { if(input < 0) throw new NumberFormatException(); @@ -104,7 +104,7 @@ public class CommandMap extends Command // Does the map generation - String GenerateMap(int width, int height, Random gen) + String generateMap(int width, int height, Random gen) { String landscape[][] = new String[width][height]; int r1 = rand(gen); diff --git a/src/commands/CommandPerish.java b/src/commands/CommandPerish.java index 8da8ba6..d372510 100644 --- a/src/commands/CommandPerish.java +++ b/src/commands/CommandPerish.java @@ -59,7 +59,7 @@ public class CommandPerish extends Command return; } preProcessed = new File(filename); - ApplyTintEffect(ImageIO.read(preProcessed), name); + applyTintEffect(ImageIO.read(preProcessed), name); } catch (IOException e) { @@ -73,7 +73,7 @@ public class CommandPerish extends Command ImageUtils.blockingFileDelete(postProcessed); } - private static void ApplyTintEffect(BufferedImage image, String name) throws IOException + private static void applyTintEffect(BufferedImage image, String name) throws IOException { // Iterate over each column left to right and touch up each pixel for(int x = 0; x < image.getWidth(); ++x) diff --git a/src/commands/CommandShutdown.java b/src/commands/CommandShutdown.java index aec54ea..b6de2ea 100644 --- a/src/commands/CommandShutdown.java +++ b/src/commands/CommandShutdown.java @@ -41,8 +41,6 @@ public class CommandShutdown extends Command break; } - - if(isSafe) { // Force upkeep, this works so long as upkeep is on the main thread. diff --git a/src/commands/CommandStark.java b/src/commands/CommandStark.java index f33b076..9795b6e 100644 --- a/src/commands/CommandStark.java +++ b/src/commands/CommandStark.java @@ -53,7 +53,7 @@ public class CommandStark extends Command return; } preProcessed = new File(filename); - ApplySnap(ImageIO.read(preProcessed), name); + applySnap(ImageIO.read(preProcessed), name); } catch (IOException e) { @@ -67,7 +67,7 @@ public class CommandStark extends Command ImageUtils.blockingFileDelete(postProcessed); } - private static void ApplySnap(BufferedImage image, String name) throws IOException + private static void applySnap(BufferedImage image, String name) throws IOException { BufferedImage snap = ImageUtils.copyImage(image); // Iterate over each column left to right and touch up each pixel