import { loggerScripts } from '/Scripts/compiler/host_access'
import { Client, NamespaceClient } from '/Scripts/client/client'
import { HookManager } from '/Scripts/engine/hooks/hook-manager'
import { SceneLoader } from '/Scripts/engine/scene/scene-loader'
import { Engine } from '/Scripts/types/engine'

/**
 * The core engine values
 */
export const engine: Engine = {
    classes: {},
    singletons: {},
    hookManager: new HookManager(),
    sceneLoader: new SceneLoader(),
}

/**
 * Called when the script engine first initializes
 */
export const ENGINE_onInit = () => {
    loggerScripts.INFO('Script Engine Beginning Initialization')

    //load namespaces
    let client: NamespaceClient = Client
    engine.sceneLoader.engine = engine
    engine.hookManager.engine = engine

    loggerScripts.INFO('Script Engine Initialized')
}
