1
+ #include " API/Mod/Mod.h"
2
+ #include " API/Logger/Logger.h"
3
+
4
+ using namespace Komomo ;
5
+
6
+ ClassDefine<ModClass> modClassBuilder = defineClass<ModClass>(" Mod" )
7
+ .constructor(nullptr )
8
+
9
+ .function(" getName" , &ModClass::getName)
10
+ .function(" getType" , &ModClass::getType)
11
+ .function(" getModDir" , &ModClass::getModDir)
12
+ .function(" getDataDir" , &ModClass::getDataDir)
13
+ .function(" getConfigDir" , &ModClass::getConfigDir)
14
+ .function(" getLangDir" , &ModClass::getLangDir)
15
+ .function(" getLogger" , &ModClass::getLogger)
16
+
17
+ .build();
18
+
19
+ ModClass::ModClass () : ScriptClass(ConstructFromCpp<ModClass>{}) {}
20
+
21
+ std::shared_ptr<ll::mod::Mod> ModClass::getMod () { return ENGINE_DATA ()->mMod ; };
22
+
23
+
24
+ // LLNDAPI std::string const& getName() const;
25
+ Local<Value> ModClass::getName () { return String::newString (ENGINE_DATA ()->mMod ->getName ()); };
26
+
27
+ // LLNDAPI std::string const& getType() const;
28
+ Local<Value> ModClass::getType () { return String::newString (ENGINE_DATA ()->mMod ->getType ()); };
29
+
30
+ // LLNDAPI std::filesystem::path const& getModDir() const;
31
+ Local<Value> ModClass::getModDir () { return String::newString (ENGINE_DATA ()->mMod ->getModDir ().string ()); };
32
+
33
+ // LLNDAPI std::filesystem::path const& getDataDir() const;
34
+ Local<Value> ModClass::getDataDir () { return String::newString (ENGINE_DATA ()->mMod ->getDataDir ().string ()); };
35
+
36
+ // LLNDAPI std::filesystem::path const& getConfigDir() const;
37
+ Local<Value> ModClass::getConfigDir () { return String::newString (ENGINE_DATA ()->mMod ->getConfigDir ().string ()); };
38
+
39
+ // LLNDAPI std::filesystem::path const& getLangDir() const;
40
+ Local<Value> ModClass::getLangDir () { return String::newString (ENGINE_DATA ()->mMod ->getLangDir ().string ()); };
41
+
42
+ // LLNDAPI ll::io::Logger& getLogger() const;
43
+ Local<Value> ModClass::getLogger () { return LoggerClass::newLoggerClass (ENGINE_DATA ()->mMod ->getLogger ().getTitle ()); };
0 commit comments