= Doodle, Map, Perish, Ping, Manage

This commit is contained in:
Matthew Cech
2019-04-06 23:22:13 -07:00
parent 9ea68605a4
commit e5a40ae329
6 changed files with 44 additions and 17 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.*;
import network.NetworkJDoodle;
@@ -11,7 +12,7 @@ public class CommandJDoodle extends Command
public CommandJDoodle(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Will compile any java code you put in! Supports Java 1.8"; }
public String HelpText() { return Localizer.Stub("Will compile any java code you put in! Supports Java 1.8"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
+7 -4
View File
@@ -3,6 +3,7 @@ package commands;
import java.util.Random;
import core.Command;
import core.Localizer;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
@@ -22,7 +23,7 @@ public class CommandMap extends Command
public CommandMap(KittyRole roleLevel, KittyRating contentRating) { super(roleLevel, contentRating); }
@Override
public String HelpText() { return "Generates a map! You can pass additional information if you want with the flags `-s<seed> -w<width> -h<height>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.\n\nDefault seed: Random,\nDefault Width: 35(max "+ MaxWidth + "),\nDefault Height: 25(max " + MaxHeight + ")"; }
public String HelpText() { return String.format(Localizer.Stub("Generates a map! You can pass additional information if you want with the flags `-s<seed> -w<width> -h<height>`. If one of the fields isn't provided, its default will be used. Note that adjusting the width and height impacts the map outcomes.\n\nDefault seed: Random,\nDefault Width: 35(max %s),\nDefault Height: 25(max %s)"), "" + MaxWidth, "" + MaxHeight); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -59,7 +60,7 @@ public class CommandMap extends Command
}
catch(NumberFormatException e)
{
res.Call("Invalid arguments provided!");
res.Call(Localizer.Stub("Invalid arguments provided!"));
return;
}
@@ -75,8 +76,10 @@ public class CommandMap extends Command
}
// Response header creation
header += "Using mapgen v0.1\n";
header += "Seed: `" + seed + "`, Width: `"+ width +"`, Height: `"+ height + "`\n";
header += Localizer.Stub("Using mapgen v0.1") + "\n";
header += Localizer.Stub("Seed") + ": `" + seed + "`, ";
header += Localizer.Stub("Width") + "`"+ width +"`, ";
header += Localizer.Stub("Height") + ": `"+ height + "`\n";
// Response body creation
body += "```\n";
+2 -1
View File
@@ -8,6 +8,7 @@ import java.io.IOException;
import javax.imageio.ImageIO;
import core.Command;
import core.Localizer;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
@@ -22,7 +23,7 @@ public class CommandPerish extends Command
public CommandPerish(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned"; };
public String HelpText() { return Localizer.Stub("Adds a red, 'a n g e r y' overlay to your icon or the icon of a friend you mentioned"); };
private static Long num = 0l;
+2 -2
View File
@@ -15,12 +15,12 @@ public class CommandPing extends Command
public CommandPing(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Will respond with Pong!"; }
public String HelpText() { return Localizer.Stub("Will respond with Pong!"); }
// Called when the command is run!
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
res.Call("Pong!");
res.Call(Localizer.Stub("Pong!"));
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ public class CommandPollManage extends Command
public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "'start' will start a new poll with the query of the line you put after, 'choice' will add a choice to the poll, 'stop' will end the poll"; }
public String HelpText() { return Localizer.Stub("'start' will start a new poll with the query of the line you put after, 'choice' will add a choice to the poll, 'stop' will end the poll"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)