package electrosphere.engine.cli;

import java.util.Arrays;
import java.util.List;

import electrosphere.engine.Globals;
import electrosphere.logger.LoggerInterface;
import electrosphere.logger.Logger.LogLevel;

public class CLIParser {
    
    public static void parseCLIArgs(String args[]){
        List<String> argList = Arrays.asList(args);
        for(int i = 0; i < argList.size(); i++){
            String argCurrent = argList.get(i);
            switch(argCurrent){
                case "--headless": {
                    Globals.RUN_CLIENT = false;
                    Globals.RUN_SERVER = true;
                    Globals.HEADLESS = true;
                } break;
                case "--simulate": {
                    Globals.RUN_SIMULATION_ONLY = true;
                } break;
                case "--maxLogs": {
                    LoggerInterface.setInitLogLevel(LogLevel.LOOP_DEBUG);
                } break;
            }
        }
        //check properties
        if(System.getProperty("maxLogs") != null){
            LoggerInterface.setInitLogLevel(LogLevel.LOOP_DEBUG);
        }
    }
    
}
