converted luascripting into c++ class