Now bindings between coral and and generatedC# correctly working

This commit is contained in:
antopilo
2025-04-04 17:11:48 -04:00
parent 1668363c4e
commit bff8ca2be1
7 changed files with 61 additions and 46 deletions

View File

@@ -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);
}
}
}
}

View File

@@ -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;