= Updated command formatting
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<KittyRole, ArrayList<Command>> commandsByRole, boolean delimitSection)
|
||||
private String populateSection(KittyRole role, HashMap<KittyRole, ArrayList<Command>> commandsByRole, boolean delimitSection)
|
||||
{
|
||||
// Formatting variables
|
||||
final String headerStart = "<h2>";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user