#306 Add command service and set up constructor dependency injection

(work in progress)
- Pass all dependencies via constructor
- Encapsulate command handling more (e.g. split CommandHandler with new CommandMapper)
- Add help command to all base commands at one central point

See AccountsCommand or HelpCommand for an example of the advantages - all necessary functions come from CommandService; objects aren't retrieved through a singleton getInstance() method anymore
This commit is contained in:
ljacqu
2015-12-23 14:54:45 +01:00
parent f785d9d357
commit 8ef1b2ae3e
14 changed files with 517 additions and 471 deletions
@@ -0,0 +1,19 @@
package fr.xephi.authme.command.executable.email;
import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.ExecutableCommand;
import org.bukkit.command.CommandSender;
import java.util.List;
/**
* Base command for /email, showing information about the child commands.
*/
public class EmailBaseCommand implements ExecutableCommand {
@Override
public void executeCommand(CommandSender sender, List<String> arguments, CommandService commandService) {
// FIXME #306 use getCommandService().getHelpProvider();
// FIXME #306 HelpProvider.printHelp()
}
}