<commit_before>package de.cpgaertner.edu.inf.api;

import de.cpgaertner.edu.inf.api.adapter.Adapter;
import de.cpgaertner.edu.inf.api.command.Command;
import de.cpgaertner.edu.inf.api.parsing.CommandSystemManager;
import de.cpgaertner.edu.inf.api.routine.Routine;
import lombok.Getter;
import lombok.Setter;

import java.io.IOException;

public class CoreEngine implements Runnable {


    protected Game game;
    protected Adapter adapter;

    @Getter @Setter protected boolean run;

    public CoreEngine(Game game, Adapter adapter) {
        this.game = game;
        this.adapter = adapter;
    }

    @Override
    public void run() {

        setRun(true);

        Routine root = game.getHostRoutine();


        Routine previousRoutine = null;
        Routine activeRoutine = game.getInitialRoutine();

        try {

            Command cmd = null;
            CommandSystemManager csm = null;


            while(isRun()) {

                // TODO clean up!
                if (previousRoutine == null) {
<commit_msg>Added RootRoutine as a fallback<commit_after>package de.cpgaertner.edu.inf.api;

import de.cpgaertner.edu.inf.api.adapter.Adapter;
import de.cpgaertner.edu.inf.api.command.Command;
import de.cpgaertner.edu.inf.api.parsing.CommandSystemManager;
import de.cpgaertner.edu.inf.api.routine.RootRoutine;
import de.cpgaertner.edu.inf.api.routine.Routine;
import lombok.Getter;
import lombok.Setter;

import java.io.IOException;

public class CoreEngine implements Runnable {


    protected Game game;
    protected Adapter adapter;

    @Getter @Setter protected boolean run;

    public CoreEngine(Game game, Adapter adapter) {
        this.game = game;
        this.adapter = adapter;
    }

    @Override
    public void run() {

        setRun(true);

        Routine root = game.getHostRoutine();

        if (root == null) {
            root = new RootRoutine(); // Fallback
        }

        Routine previousRoutine = null;
        Routine activeRoutine = game.getInitialRoutine();

        try {

            Command cmd = null;
            CommandSystemManager csm = null;


            while(isRun()) {

                // TODO clean up!
                if (previousRoutine == null) {

{'fraction_non_alphanumeric': 0.09594594594594595, 'fraction_numerical': 0.0, 'mean_word_length': 2.475743348982786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3945541', 'n_tokens_mistral': 690, 'n_tokens_neox': 655, 'n_words': 151}