=Started character subcommand routine and edited guildrole class names
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package commands.characters;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.LocStrings;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.*;
|
||||
|
||||
public class CommandCharacterCreate extends SubCommand
|
||||
{
|
||||
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
{
|
||||
String [] info = input.split(",");
|
||||
if(info.length < 3)
|
||||
{
|
||||
return new SubCommandFormattable (LocStrings.stub("CharacterCreateNullInfo"));
|
||||
}
|
||||
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
|
||||
{
|
||||
return new SubCommandFormattable (LocStrings.stub("CharacterCreateSuccess"));
|
||||
|
||||
}
|
||||
return new SubCommandFormattable (LocStrings.stub("CharacterCreateDuplicate"));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands.general;
|
||||
package commands.characters;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands.general;
|
||||
package commands.characters;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands.general;
|
||||
package commands.characters;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
@@ -0,0 +1,33 @@
|
||||
package commands.characters;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import core.SubCommandFramework;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandCharacterMain extends Command
|
||||
{
|
||||
SubCommandFramework framework = new SubCommandFramework();
|
||||
public CommandCharacterMain(KittyRole level, KittyRating rating)
|
||||
{
|
||||
super(level, rating);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpText() { return LocStrings.stub("CharacterInfo"); }
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
framework.run(guild, channel, user, input.args).Call(res);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package commands.general;
|
||||
package commands.characters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package commands.general;
|
||||
|
||||
import core.CharacterManager;
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandCharacterCreate extends Command
|
||||
{
|
||||
public CommandCharacterCreate(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String getHelpText() { return LocStrings.stub("CharacterCreateInfo"); }
|
||||
|
||||
@Override
|
||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
String [] info = input.args.split(",");
|
||||
if(info.length < 3)
|
||||
{
|
||||
res.send(LocStrings.stub("CharacterCreateNullInfo"));
|
||||
return;
|
||||
}
|
||||
if(CharacterManager.instance.addCharacter(user, info[0], info[1], info[2]))
|
||||
{
|
||||
res.send(LocStrings.stub("CharacterCreateSuccess"));
|
||||
return;
|
||||
}
|
||||
res.send(LocStrings.stub("CharacterCreateDuplicate"));
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,10 @@ public class CommandGuildRoleMain extends Command
|
||||
public CommandGuildRoleMain(KittyRole level, KittyRating rating)
|
||||
{
|
||||
super(level, rating);
|
||||
framework.addCommand("add", new CommandGuildRoleAdd (KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("remove", new CommandGuildRoleRemove(KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("allowed", new CommandGuildRoleAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
framework.addCommand("unallowed", new CommandGuildRoleNotAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
framework.addCommand("add", new SubCommandAdd (KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("remove", new SubCommandRemove(KittyRole.General, KittyRating.Safe));
|
||||
framework.addCommand("allowed", new SubCommandAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
framework.addCommand("unallowed", new SubCommandNotAllowed(KittyRole.Admin, KittyRating.Safe));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleAdd extends SubCommand
|
||||
public class SubCommandAdd extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleAdd(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandAdd(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 CommandGuildRoleAllowed extends SubCommand
|
||||
public class SubCommandAllowed extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
+2
-2
@@ -9,10 +9,10 @@ import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
|
||||
public class CommandGuildRoleList extends SubCommand
|
||||
public class SubCommandList extends SubCommand
|
||||
{
|
||||
|
||||
public CommandGuildRoleList(KittyRole level, KittyRating rating) { super(level, rating);}
|
||||
public SubCommandList(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 CommandGuildRoleNotAllowed extends SubCommand
|
||||
public class SubCommandNotAllowed extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleNotAllowed(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandNotAllowed(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 CommandGuildRoleRemove extends SubCommand
|
||||
public class SubCommandRemove extends SubCommand
|
||||
{
|
||||
public CommandGuildRoleRemove(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
public SubCommandRemove(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, String input)
|
||||
Reference in New Issue
Block a user