Now bindings between coral and and generatedC# correctly working
This commit is contained in:
@@ -15,28 +15,25 @@ namespace Nuake
|
||||
|
||||
void ModulesAPI::RegisterMethods()
|
||||
{
|
||||
isModule = true;
|
||||
const std::string& internalPrefix = "Internals";
|
||||
|
||||
for (auto& name : ModuleDB::Get().GetModules())
|
||||
{
|
||||
const std::string& modulePrefix = internalPrefix + "." + name;
|
||||
auto meta = entt::resolve(entt::hashed_string(("class " + name).c_str()));
|
||||
auto instance = ModuleDB::Get().GetBaseImpl(name).instance;
|
||||
for (auto [id, func] : meta.func())
|
||||
{
|
||||
auto funcName = func.prop(HashedName::DisplayName);
|
||||
const std::string funcNameStd = funcName.value().try_cast<std::string>()->c_str();
|
||||
const std::string& fullName = modulePrefix + funcNameStd;
|
||||
|
||||
auto funcPtrMeta = func.prop(HashedUserValue::FuncPtr);
|
||||
auto funcPtr = funcPtrMeta.value().try_cast<void*>();
|
||||
|
||||
RegisterMethod("Internals.SetVolumeICall", &SetVolume);
|
||||
|
||||
//const std::string& internalPrefix = "Internal";
|
||||
//
|
||||
//for (auto& name : ModuleDB::Get().GetModules())
|
||||
//{
|
||||
// const std::string& modulePrefix = internalPrefix + ".";
|
||||
// auto meta = entt::resolve(entt::hashed_string(("class " + name).c_str()));
|
||||
// auto instance = ModuleDB::Get().GetBaseImpl(name).instance;
|
||||
// for (auto [id, func] : meta.func())
|
||||
// {
|
||||
// auto funcName = func.prop(HashedName::DisplayName);
|
||||
// const std::string funcNameStd = funcName.value().try_cast<std::string>()->c_str();
|
||||
// const std::string& fullName = modulePrefix + funcNameStd;
|
||||
//
|
||||
// auto funcPtrMeta = func.prop(HashedUserValue::FuncPtr);
|
||||
// auto funcPtr = funcPtrMeta.value().try_cast<void*>();
|
||||
// RegisterMethod(fullName, &SetVolume);
|
||||
// }
|
||||
//}
|
||||
RegisterMethod(fullName + "ICall", *funcPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace Nuake {
|
||||
class NetAPIModule
|
||||
{
|
||||
public:
|
||||
bool isModule = false;
|
||||
|
||||
using MethodMap = std::unordered_map<std::string, void*>;
|
||||
|
||||
virtual const std::string GetModuleName() const = 0;
|
||||
|
||||
Reference in New Issue
Block a user