package org.studiorailgun;

import org.studiorailgun.ai.conversation.categorization.SentenceFunctionCategorizor;
import org.studiorailgun.ai.conversation.evaluators.greet.GreetingEval;
import org.studiorailgun.ai.conversation.parser.NLPParser;
import org.studiorailgun.ai.conversation.parser.bank.LemmaBank;
import org.studiorailgun.ai.conversation.tracking.Conversation;
import org.studiorailgun.ai.knowledge.CSVExport;
import org.studiorailgun.ai.knowledge.KnowledgeWeb;
import org.studiorailgun.sim.space.World;
import org.studiorailgun.sim.character.Character;
import org.studiorailgun.sim.config.Config;

/**
 * Global variables
 */
public class Globals {
    
    /**
     * The knowledge web
     */
    public static KnowledgeWeb web;

    /**
     * The current conversation
     */
    public static Conversation conversation;

    /**
     * The simulation world
     */
    public static World world;

    /**
     * The player's character
     */
    public static Character playerCharacter;

    /**
     * The simulation config
     */
    public static Config config;

    /**
     * Initializes the knowledge web
     */
    public static void init(String webPath){
        //initialize evaluators
        GreetingEval.init();
        SentenceFunctionCategorizor.init();
        LemmaBank.init();

        //init nlp parser
        NLPParser.init();

        //init web
        Globals.web = KnowledgeWeb.load(webPath);
        Globals.web.initLinks();

        CSVExport.export("temp");

        //init convo
        Globals.conversation = Conversation.parse(Globals.web);

        //load simulation config
        Globals.config = Config.init();
    }

}
