Search in sources :

Example 1 with ClassType

use of ultima.Constants.ClassType in project ultimate-java by pantinor.

the class TestJaxb method testStartQuestions.

// @Test
public void testStartQuestions() throws Exception {
    Map<ClassType, Integer> dist = new HashMap<>();
    for (ClassType ct : ClassType.values()) {
        dist.put(ct, 0);
    }
    for (int z = 0; z < 100; z++) {
        StartScreen.questionRound = 0;
        StartScreen.initQuestionTree();
        System.out.println("INIT\n");
        for (int i = 0; i < 15; i++) {
            System.out.println(i + ") " + Virtue.get(StartScreen.questionTree[i]));
        }
        while (!StartScreen.doQuestion(new Random().nextInt(2))) {
            printQuestionDesc(StartScreen.questionRound);
        }
        // System.out.println("\nANSWERS\n");
        // for (int i = 0; i < 15; i++) {
        // System.out.println(i + ") " +Virtue.get(StartScreen.questionTree[i]));
        // }
        SaveGame sg = new SaveGame();
        SaveGame.SaveGamePlayerRecord avatar = sg.new SaveGamePlayerRecord();
        avatar.adjuestAttribsPerKarma(StartScreen.questionTree);
        avatar.klass = ClassType.get(StartScreen.questionTree[14]);
        int[] questionTree = StartScreen.questionTree;
        // System.out.println(avatar.klass);
        dist.put(avatar.klass, dist.get(avatar.klass) + 1);
    }
    for (ClassType ct : ClassType.values()) {
        System.out.println(ct + " " + dist.get(ct));
    }
}
Also used : Random(java.util.Random) XORShiftRandom(util.XORShiftRandom) HashMap(java.util.HashMap) SaveGame(objects.SaveGame) ClassType(ultima.Constants.ClassType)

Aggregations

HashMap (java.util.HashMap)1 Random (java.util.Random)1 SaveGame (objects.SaveGame)1 ClassType (ultima.Constants.ClassType)1 XORShiftRandom (util.XORShiftRandom)1