Search in sources :

Example 1 with DEBUG_FUNCTIONS

use of eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS in project Eidolons by IDemiurge.

the class FunctionPanel method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    // cache
    new Thread(new Runnable() {

        @Override
        public void run() {
            DEBUG_FUNCTIONS func = new EnumMaster<DEBUG_FUNCTIONS>().retrieveEnumConst(DEBUG_FUNCTIONS.class, e.getActionCommand());
            if (func == null) {
                HIDDEN_DEBUG_FUNCTIONS hfunc = new EnumMaster<HIDDEN_DEBUG_FUNCTIONS>().retrieveEnumConst(HIDDEN_DEBUG_FUNCTIONS.class, e.getActionCommand());
                master.executeHiddenDebugFunction(hfunc);
                return;
            }
            master.executeDebugFunction(func);
        }
    }, "function " + e.getActionCommand()).start();
// Game.game.getManager().reset();
}
Also used : HIDDEN_DEBUG_FUNCTIONS(eidolons.test.debug.DebugMaster.HIDDEN_DEBUG_FUNCTIONS) DEBUG_FUNCTIONS(eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS) HIDDEN_DEBUG_FUNCTIONS(eidolons.test.debug.DebugMaster.HIDDEN_DEBUG_FUNCTIONS)

Example 2 with DEBUG_FUNCTIONS

use of eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS in project Eidolons by IDemiurge.

the class DebugMaster method promptFunctionToExecute.

public void promptFunctionToExecute() {
    DC_SoundMaster.playStandardSound(RandomWizard.random() ? STD_SOUNDS.DIS__OPEN_MENU : STD_SOUNDS.SLING);
    String message = "Input function name";
    String funcName = JOptionPane.showInputDialog(null, message, lastFunction);
    if (funcName == null) {
        if (AutoTestMaster.isRunning()) {
            funcName = DEBUG_FUNCTIONS.AUTO_TEST_INPUT.name();
        } else {
            reset();
            return;
        }
    }
    if (AutoTestMaster.isRunning()) {
        if (funcName.equalsIgnoreCase("re")) {
            new Thread(new Runnable() {

                public void run() {
                    AutoTestMaster.runTests();
                }
            }, " thread").start();
            return;
        }
    }
    if (funcName.contains(" ")) {
        if (funcName.trim().equals("")) {
            int length = funcName.length();
            if (executedFunctions.size() >= length) {
                for (int i = 0; i < length; i++) {
                    funcName = executedFunctions.pop();
                }
            }
        }
    }
    if (StringMaster.isInteger(funcName)) {
        try {
            Integer integer = StringMaster.getInteger(funcName);
            if (integer >= DEBUG_FUNCTIONS.values().length) {
                executeDebugFunctionNewThread(HIDDEN_DEBUG_FUNCTIONS.values()[integer - DEBUG_FUNCTIONS.values().length]);
                playFuncExecuteSound();
                return;
            }
            {
                executeDebugFunctionNewThread(DEBUG_FUNCTIONS.values()[integer]);
                playFuncExecuteSound();
                return;
            }
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    }
    DEBUG_FUNCTIONS function = new EnumMaster<DEBUG_FUNCTIONS>().retrieveEnumConst(DEBUG_FUNCTIONS.class, funcName);
    if (function != null) {
        executeDebugFunctionNewThread(function);
        playFuncExecuteSound();
        return;
    }
    HIDDEN_DEBUG_FUNCTIONS function2 = new EnumMaster<HIDDEN_DEBUG_FUNCTIONS>().retrieveEnumConst(HIDDEN_DEBUG_FUNCTIONS.class, funcName);
    if (function2 != null) {
        executeDebugFunctionNewThread(function2);
    } else {
        function = new EnumMaster<DEBUG_FUNCTIONS>().retrieveEnumConst(DEBUG_FUNCTIONS.class, funcName, true);
        function2 = new EnumMaster<HIDDEN_DEBUG_FUNCTIONS>().retrieveEnumConst(HIDDEN_DEBUG_FUNCTIONS.class, funcName, true);
        if (StringMaster.compareSimilar(funcName, function.toString()) > StringMaster.compareSimilar(funcName, function2.toString())) {
            executeDebugFunctionNewThread(function);
        } else {
            executeDebugFunctionNewThread(function2);
        }
    }
    playFuncExecuteSound();
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) DEBUG_FUNCTIONS(eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS)

Example 3 with DEBUG_FUNCTIONS

use of eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS in project Eidolons by IDemiurge.

the class DebugMaster method typeInFunction.

public Object typeInFunction() {
    String funcName = JOptionPane.showInputDialog("Type in function to execute");
    HIDDEN_DEBUG_FUNCTIONS func = new EnumMaster<HIDDEN_DEBUG_FUNCTIONS>().retrieveEnumConst(HIDDEN_DEBUG_FUNCTIONS.class, funcName);
    if (func != null) {
        return executeHiddenDebugFunction(func);
    } else {
        DEBUG_FUNCTIONS func1 = new EnumMaster<DEBUG_FUNCTIONS>().retrieveEnumConst(DEBUG_FUNCTIONS.class, funcName);
        if (func1 != null) {
            return executeDebugFunction(func1);
        }
    }
    return null;
}
Also used : DEBUG_FUNCTIONS(eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS)

Aggregations

DEBUG_FUNCTIONS (eidolons.test.debug.DebugMaster.DEBUG_FUNCTIONS)3 HIDDEN_DEBUG_FUNCTIONS (eidolons.test.debug.DebugMaster.HIDDEN_DEBUG_FUNCTIONS)1 EnumMaster (main.system.auxiliary.EnumMaster)1