Major cleanup.

Moved to namespace
Cleanup includes
This commit is contained in:
Antoine Pilote
2021-07-11 18:56:44 -04:00
parent f77bef6b28
commit 0c6ed48bbd
174 changed files with 11772 additions and 11296 deletions

View File

@@ -6,33 +6,34 @@
#include <iostream>
#include <wren.h>
namespace ScriptAPI
namespace Nuake
{
class EngineModule : public ScriptModule
namespace ScriptAPI
{
std::string ModuleName = "Engine";
std::string WrenAPI = "class Engine { \n"
"foreign static Log(msg) \n"
"}"
"";
std::string GetModuleName() override
class EngineModule : public ScriptModule
{
return "Engine";
}
std::string ModuleName = "Engine";
std::string WrenAPI = "class Engine { \n"
"foreign static Log(msg) \n"
"}"
"";
void RegisterModule(WrenVM* vm) override
{
RegisterMethod("Log(_)", (void*)Log);
WrenInterpretResult result = wrenInterpret(vm, "main", WrenAPI.c_str());
}
static void Log(WrenVM* vm)
{
std::string msg = wrenGetSlotString(vm, 1);
Logger::Log(msg);
}
};
std::string GetModuleName() override
{
return "Engine";
}
void RegisterModule(WrenVM* vm) override
{
RegisterMethod("Log(_)", (void*)Log);
WrenInterpretResult result = wrenInterpret(vm, "main", WrenAPI.c_str());
}
static void Log(WrenVM* vm)
{
std::string msg = wrenGetSlotString(vm, 1);
Logger::Log(msg);
}
};
}
}