=More SubCommand Routine Mods
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
package commands.poll;
|
||||
|
||||
import core.*;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandPollManage extends Command
|
||||
{
|
||||
public CommandPollManage(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String getHelpText() { return LocStrings.stub("PollManageInfo"); }
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
switch(input.args.split(" ")[0].toLowerCase())
|
||||
{
|
||||
case "start":
|
||||
res.send(guild.startPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
||||
break;
|
||||
|
||||
case "choice":
|
||||
res.send(guild.addChoiceToPoll(input.args.substring(input.args.indexOf(' ')).trim()));
|
||||
break;
|
||||
|
||||
case "stop":
|
||||
res.send(guild.endPoll());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package commands.poll;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class SubCommandAddOption extends SubCommand
|
||||
{
|
||||
|
||||
public SubCommandAddOption(KittyRole roleLevel, KittyRating contentRating) {super(roleLevel, contentRating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
return new SubCommandFormattable (guild.addChoiceToPoll(input));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package commands.poll;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class SubCommandEnd extends SubCommand
|
||||
{
|
||||
|
||||
public SubCommandEnd(KittyRole roleLevel, KittyRating contentRating) {super(roleLevel, contentRating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
return new SubCommandFormattable (guild.endPoll());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package commands.poll;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class SubCommandStart extends SubCommand
|
||||
{
|
||||
|
||||
public SubCommandStart(KittyRole roleLevel, KittyRating contentRating) {super(roleLevel, contentRating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
return new SubCommandFormattable (guild.startPoll(input));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,10 +10,10 @@ public class CommandRaffleMain extends Command
|
||||
public CommandRaffleMain(KittyRole level, KittyRating rating)
|
||||
{
|
||||
super(level, rating);
|
||||
framework.addCommand("start", new CommandRaffleStart(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("spin", new CommandRaffleSpin(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("end", new CommandRaffleEnd(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("join", new CommandRaffleJoin(KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("start", new SubCommandStart(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("spin", new SubCommandSpin(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("end", new SubCommandEnd(KittyRole.Mod, KittyRating.Safe));
|
||||
framework.addCommand("join", new SubCommandJoin(KittyRole.General, KittyRating.Safe));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,9 +9,9 @@ import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandRaffleEnd extends SubCommand
|
||||
public class SubCommandEnd extends SubCommand
|
||||
{
|
||||
public CommandRaffleEnd(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandEnd(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
+2
-2
@@ -5,9 +5,9 @@ import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandRaffleJoin extends SubCommand
|
||||
public class SubCommandJoin extends SubCommand
|
||||
{
|
||||
public CommandRaffleJoin(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandJoin(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
+2
-2
@@ -9,9 +9,9 @@ import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandRaffleSpin extends SubCommand
|
||||
public class SubCommandSpin extends SubCommand
|
||||
{
|
||||
public CommandRaffleSpin(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandSpin(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
+2
-2
@@ -5,9 +5,9 @@ import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandRaffleStart extends SubCommand
|
||||
public class SubCommandStart extends SubCommand
|
||||
{
|
||||
public CommandRaffleStart(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandStart(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
public int beanCost;
|
||||
|
||||
Reference in New Issue
Block a user