-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCactusMod.cpp
More file actions
52 lines (39 loc) · 1.08 KB
/
Copy pathCactusMod.cpp
File metadata and controls
52 lines (39 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "CactusMod.h"
#include <string_view>
#include "sol/sol.hpp"
std::string_view CactusMod::getName() const {
return metadata.at("name");
};
std::string_view CactusMod::getModID() const {
return metadata.at("modId");
};
sol::protected_function CactusMod::getServerFunction(std::string n) {
return getServerEnv()[n];
};
sol::protected_function CactusMod::getClientFunction(std::string n) {
return getClientEnv()[n];
};
std::string_view CactusMod::getServerEntry() const {
return metadata.at("serverMain");
};
std::string_view CactusMod::getClientEntry() const {
return metadata.at("clientMain");
};
std::string_view CactusMod::getPathName() const {
return pathName;
}
void CactusMod::setPathName(std::string name) {
pathName = name;
}
void CactusMod::setServerEnv(sol::environment env) {
serverEnv = std::move(env);
};
void CactusMod::setClientEnv(sol::environment env) {
clientEnv = std::move(env);
};
sol::environment& CactusMod::getServerEnv() {
return serverEnv;
};
sol::environment& CactusMod::getClientEnv() {
return clientEnv;
};