require "luascape.reflect"

reflect.loadReflectors("logic")
reflect.makeNamespaceGlobal("scape::logic")
reflect.makeNamespaceGlobal("scape::logic::controllers")
reflect.makeNamespaceGlobal("scape::logic::message")
reflect.makeNamespaceGlobal("scape::logic::model")
reflect.makeNamespaceGlobal("scape::logic::actions")

logic = {}
  function logic.addScriptController(entity, scriptFilename)
    local script
    if scriptFilename then
      script = Script.loadScript(scriptFilename)
    else
      script = createSharedLuaScript()
    end 
    local scriptController = entity.controllers:add(ScriptController())
    scriptController.script = script
    return scriptController
  end

