// Path: src/main/java/net/teamtf/launcher/core/Launcher.java
// public interface Launcher {
//     public void launch();
//     public TaskManager getLaunchTaskManager();
// }
// 
// Path: src/main/java/net/teamtf/launcher/util/task/SynchronizedTask.java
// public abstract class SynchronizedTask implements Task {
// 
//     private TaskExecuteException exceptionDuringExecuting;
// 
//     public SynchronizedTask() {
// 
//     }
// 
//     @Override
//     public abstract void run();
// 
//     @Override
//     public Boolean isSynchronized() {
//         return true;
//     }
// 
//     @Override
//     public TaskExecuteException getTaskExecuteException() {
//         return this.exceptionDuringExecuting;
//     }
//     
//        
//     protected void setTaskExecuteException(Exception exception) {
//        this.exceptionDuringExecuting=new TaskExecuteException(this, exception);
//     }
// }
// 
// Path: src/main/java/net/teamtf/launcher/util/task/TaskManager.java
// public class TaskManager {
// 
//     private final LinkedList<Task> tasks;
// 
//     public TaskManager() {
//         this.tasks = new LinkedList<>();
//     }
// 
//     public Void executeTasks() {
// 
//         LinkedList<Task> reversedList = (LinkedList<Task>) this.tasks.clone();
//         Collections.reverse(this.tasks);
// 
//         ExecutorService syncPool = Executors.newSingleThreadExecutor();
//         ExecutorService asyncPool = Executors.newCachedThreadPool();
// 
// 
//         for (Task task : reversedList) {
//             if (task.isSynchronized()) {
//                 syncPool.execute(task);
//                 if (task.getTaskExecuteException() != null) {
//                     throw task.getTaskExecuteException();
//                 }
//             } else {
//                 asyncPool.execute(task);
//             }
//         }
//         syncPool.shutdown();
//         asyncPool.shutdown();
//         return null;
//     }
// 
//     /**
//      * Insert task at the end of task list
//      *
//      * @param task the task which you want insert
//      */
//     public void insertTask(Task task) {
//         this.tasks.add(task);
//     }
// 
//     /**
//      * Insert task at certain index of task list
//      *
//      * @param index the sequence you want your task execute
//      * @param task  the task which you want insert
//      */
//     public void insertTask(Integer index, Task task) {
//         this.tasks.add(index, task);
//     }
// 
//     /**
//      * Remove task which at the end of task list
//      *
//      * @param index the sequence of task
//      */
//     public void removeTask(Integer index) {
//         this.tasks.remove(index.intValue());
//     }
// 
//     /**
//      * Receive index of certain task through task.
//      *
//      * @param taskName of task
//      * @return first index of task which hold that name, -1 if not exists.
//      */
//     public Integer getTaskSequenceByName(String taskName) {
//         for (int i = 0; i < this.tasks.size(); i++) {
//             if (this.tasks.get(i).getName().equals(taskName)) {
//                 return i + 1;
//             }
//         }
//         return -1;
//     }
// 
// }


import net.teamtf.launcher.core.Launcher;
import net.teamtf.launcher.util.task.SynchronizedTask;
import net.teamtf.launcher.util.task.TaskManager;
package net.teamtf.launcher.basis;


/**
 * @Author Decker
 */
public class DefaultLauncher implements Launcher {
    private TaskManager launchTaskManager;

    public DefaultLauncher() {
        this.launchTaskManager = new TaskManager();
// Path: src/main/java/net/teamtf/launcher/core/Launcher.java
// public interface Launcher {
//     public void launch();
//     public TaskManager getLaunchTaskManager();
// }
// 
// Path: src/main/java/net/teamtf/launcher/util/task/SynchronizedTask.java
// public abstract class SynchronizedTask implements Task {
// 
//     private TaskExecuteException exceptionDuringExecuting;
// 
//     public SynchronizedTask() {
// 
//     }
// 
//     @Override
//     public abstract void run();
// 
//     @Override
//     public Boolean isSynchronized() {
//         return true;
//     }
// 
//     @Override
//     public TaskExecuteException getTaskExecuteException() {
//         return this.exceptionDuringExecuting;
//     }
//     
//        
//     protected void setTaskExecuteException(Exception exception) {
//        this.exceptionDuringExecuting=new TaskExecuteException(this, exception);
//     }
// }
// 
// Path: src/main/java/net/teamtf/launcher/util/task/TaskManager.java
// public class TaskManager {
// 
//     private final LinkedList<Task> tasks;
// 
//     public TaskManager() {
//         this.tasks = new LinkedList<>();
//     }
// 
//     public Void executeTasks() {
// 
//         LinkedList<Task> reversedList = (LinkedList<Task>) this.tasks.clone();
//         Collections.reverse(this.tasks);
// 
//         ExecutorService syncPool = Executors.newSingleThreadExecutor();
//         ExecutorService asyncPool = Executors.newCachedThreadPool();
// 
// 
//         for (Task task : reversedList) {
//             if (task.isSynchronized()) {
//                 syncPool.execute(task);
//                 if (task.getTaskExecuteException() != null) {
//                     throw task.getTaskExecuteException();
//                 }
//             } else {
//                 asyncPool.execute(task);
//             }
//         }
//         syncPool.shutdown();
//         asyncPool.shutdown();
//         return null;
//     }
// 
//     /**
//      * Insert task at the end of task list
//      *
//      * @param task the task which you want insert
//      */
//     public void insertTask(Task task) {
//         this.tasks.add(task);
//     }
// 
//     /**
//      * Insert task at certain index of task list
//      *
//      * @param index the sequence you want your task execute
//      * @param task  the task which you want insert
//      */
//     public void insertTask(Integer index, Task task) {
//         this.tasks.add(index, task);
//     }
// 
//     /**
//      * Remove task which at the end of task list
//      *
//      * @param index the sequence of task
//      */
//     public void removeTask(Integer index) {
//         this.tasks.remove(index.intValue());
//     }
// 
//     /**
//      * Receive index of certain task through task.
//      *
//      * @param taskName of task
//      * @return first index of task which hold that name, -1 if not exists.
//      */
//     public Integer getTaskSequenceByName(String taskName) {
//         for (int i = 0; i < this.tasks.size(); i++) {
//             if (this.tasks.get(i).getName().equals(taskName)) {
//                 return i + 1;
//             }
//         }
//         return -1;
//     }
// 
// }


// Path: src/main/java/net/teamtf/launcher/basis/DefaultLauncher.java
import net.teamtf.launcher.core.Launcher;
import net.teamtf.launcher.util.task.SynchronizedTask;
import net.teamtf.launcher.util.task.TaskManager;

package net.teamtf.launcher.basis;


/**
 * @Author Decker
 */
public class DefaultLauncher implements Launcher {
    private TaskManager launchTaskManager;

    public DefaultLauncher() {
        this.launchTaskManager = new TaskManager();
        this.launchTaskManager.insertTask(new SynchronizedTask() {