C# Entity Scrips now working(OnInit, update, destroy) [ Broke reloading]

- added UI button to generate a .sln in the games folder
- added UI for adding new component and drag n drop .cs file
- added modular Core API module system
This commit is contained in:
Antoine Pilote
2023-10-16 00:21:28 -04:00
parent 9807f0fa8f
commit af2546fb21
21 changed files with 677 additions and 50 deletions

View File

@@ -0,0 +1,15 @@
#include "EngineNetAPI.h"
namespace Nuake {
void Log(Coral::NativeString string)
{
Logger::Log(string.ToString(), ".net", VERBOSE);
}
void EngineNetAPI::RegisterMethods()
{
RegisterMethod("LoggerLogIcall", (void*)(&Log));
}
}

View File

@@ -0,0 +1,14 @@
#pragma once
#include "NetAPIModule.h"
namespace Nuake {
class EngineNetAPI : public NetAPIModule
{
public:
virtual const std::string GetModuleName() const override { return "Engine"; }
virtual void RegisterMethods() override;
};
}

View File

@@ -0,0 +1,25 @@
#pragma once
#include "src/Core/Core.h"
#include "src/Core/Logger.h"
#include <Coral/NativeString.hpp>
namespace Nuake {
class NetAPIModule
{
public:
virtual const std::string GetModuleName() const = 0;
virtual void RegisterMethods() = 0;
std::unordered_map<std::string, void*> GetMethods() const { return m_Methods; }
protected:
void RegisterMethod(const std::string& name, void* methodPtr)
{
m_Methods.emplace(name, methodPtr);
}
private:
std::unordered_map<std::string, void*> m_Methods;
};
}