Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ScriptClass.hpp
1#pragma once
2
3#include <string>
4#include <map>
5
6#include <mono/metadata/class.h>
7#include <mono/metadata/object-forward.h>
8
9namespace Grindstone {
10 namespace Scripting {
11 namespace CSharp {
12 struct ScriptField {
13 // ScriptFieldType type;
14 std::string name;
15 MonoClassField* classFieldPtr;
16
17 ScriptField() = default;
18 ScriptField(std::string name, MonoClassField* classFieldPtr);
19 virtual void Get(MonoObject* object, void* outValue);
20 virtual void Set(MonoObject* object, void* outValue);
21 };
22
23 struct ScriptClass {
24 std::string scriptNamespace;
25 std::string scriptClassname;
26 MonoClass* monoClass = nullptr;
27 std::map<std::string, ScriptField> fields;
28
29 struct Methods {
30 MonoMethod* constructor = nullptr;
31 MonoMethod* onAttachComponent = nullptr;
32 MonoMethod* onStart = nullptr;
33 MonoMethod* onUpdate = nullptr;
34 MonoMethod* onEditorUpdate = nullptr;
35 MonoMethod* onDelete = nullptr;
36 } methods;
37
38 ScriptClass() = default;
40 std::string scriptNamespace,
41 std::string scriptClassname,
42 MonoClass* monoClass
43 );
44 };
45 }
46 }
47}
Definition ScriptClass.hpp:23
Definition ScriptClass.hpp:12