Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. public class Main {
  2.  
  3. private static GroupManager groupManager;
  4.  
  5. public static List<Command> commands;
  6.  
  7. public Main() { }
  8.  
  9. @SuppressWarnings("unused")
  10. public static void main(String args[]) throws Exception {
  11.  
  12. Logger info = new Logger("i");
  13. Logger err = new Logger("e");
  14. Logger warn = new Logger("w");
  15.  
  16. info.send("Master startet...");
  17.  
  18. new FileManager().create();
  19.  
  20. groupManager = new GroupManager();
  21.  
  22. new Logger().send("\n" +
  23. " _________ ________ ________ \r\n" +
  24. "|\\___ ___\\ |\\ __ \\ |\\ ____\\ \r\n" +
  25. "\\|___ \\ \\_| \\ \\ \\|\\ /_ \\ \\ \\___| \r\n" +
  26. " \\ \\ \\ \\ \\ __ \\ \\ \\ \\ \r\n" +
  27. " \\ \\ \\ __\\ \\ \\|\\ \\ __\\ \\ \\____ \r\n" +
  28. " \\ \\__\\\\__\\ \\_______\\\\__\\ \\_______\\\r\n" +
  29. " \\|__\\|__|\\|_______\\|__|\\|_______|\r\n" +
  30. " ");
  31. info.send("Master wurde gestartet...");
  32.  
  33. registerCommands();
  34.  
  35. }
  36.  
  37. private static void registerCommands() {
  38.  
  39. addCommands(new StopCommand());
  40.  
  41. try {
  42.  
  43. BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  44. String line;
  45.  
  46. while((line = reader.readLine()) != null) {
  47.  
  48. if(line.length() != 0) {
  49. for(Command command : commands) {
  50.  
  51. command.execute(line.split(" "));
  52.  
  53. }
  54. }
  55.  
  56. }
  57.  
  58. } catch(Exception e) { new Logger("e").send(e.getMessage()); }
  59.  
  60. }
  61.  
  62. private static void addCommands(Command command) {
  63. commands.add(command);
  64. }
  65.  
  66. public GroupManager getGroupManager() {
  67. return groupManager;
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement