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:
15
Nuake/src/Scripting/NetModules/EngineNetAPI.cpp
Normal file
15
Nuake/src/Scripting/NetModules/EngineNetAPI.cpp
Normal 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));
|
||||
}
|
||||
|
||||
}
|
||||
14
Nuake/src/Scripting/NetModules/EngineNetAPI.h
Normal file
14
Nuake/src/Scripting/NetModules/EngineNetAPI.h
Normal 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;
|
||||
|
||||
};
|
||||
}
|
||||
25
Nuake/src/Scripting/NetModules/NetAPIModule.h
Normal file
25
Nuake/src/Scripting/NetModules/NetAPIModule.h
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user