MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / LoadClassGameObject

Function LoadClassGameObject

src/Core/Bindings/obe/Script/Script.cpp:10–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace obe::Script::Bindings
9{
10 void LoadClassGameObject(sol::state_view state)
11 {
12 sol::table ScriptNamespace = state["obe"]["Script"].get<sol::table>();
13 sol::usertype<obe::Script::GameObject> bindGameObject
14 = ScriptNamespace.new_usertype<obe::Script::GameObject>("GameObject",
15 sol::call_constructor,
16 sol::constructors<obe::Script::GameObject(obe::Triggers::TriggerManager&,
17 sol::state_view, const std::string&, const std::string&)>(),
18 sol::base_classes,
19 sol::bases<obe::Types::Identifiable, obe::Types::Serializable>());
20 bindGameObject["getType"] = &obe::Script::GameObject::getType;
21 bindGameObject["doesHaveAnimator"] = &obe::Script::GameObject::doesHaveAnimator;
22 bindGameObject["doesHaveCollider"] = &obe::Script::GameObject::doesHaveCollider;
23 bindGameObject["doesHaveSprite"] = &obe::Script::GameObject::doesHaveSprite;
24 bindGameObject["doesHaveScriptEngine"]
25 = &obe::Script::GameObject::doesHaveScriptEngine;
26 bindGameObject["getUpdateState"] = &obe::Script::GameObject::getUpdateState;
27 bindGameObject["setUpdateState"] = &obe::Script::GameObject::setUpdateState;
28 bindGameObject["Animator"] = sol::property(&obe::Script::GameObject::getAnimator);
29 bindGameObject["Collider"] = sol::property(&obe::Script::GameObject::getCollider);
30 bindGameObject["Sprite"] = sol::property(&obe::Script::GameObject::getSprite);
31 bindGameObject["SceneNode"]
32 = sol::property(&obe::Script::GameObject::getSceneNode);
33 bindGameObject["useTrigger"] = sol::overload(
34 [](obe::Script::GameObject* self, const std::string& trNsp,
35 const std::string& trGrp, const std::string& trName) -> void {
36 return self->useTrigger(trNsp, trGrp, trName);
37 },
38 [](obe::Script::GameObject* self, const std::string& trNsp,
39 const std::string& trGrp, const std::string& trName,
40 const std::string& callAlias) -> void {
41 return self->useTrigger(trNsp, trGrp, trName, callAlias);
42 });
43 bindGameObject["removeTrigger"] = &obe::Script::GameObject::removeTrigger;
44 bindGameObject["exec"] = &obe::Script::GameObject::exec;
45 bindGameObject["sendInitArg"] = &obe::Script::GameObject::sendInitArgFromLua;
46 bindGameObject["registerTrigger"] = &obe::Script::GameObject::registerTrigger;
47 bindGameObject["loadGameObject"] = sol::overload(
48 [](obe::Script::GameObject* self, obe::Scene::Scene& scene,
49 vili::node& obj) -> void { return self->loadGameObject(scene, obj); },
50 [](obe::Script::GameObject* self, obe::Scene::Scene& scene, vili::node& obj,
51 obe::Engine::ResourceManager* resources) -> void {
52 return self->loadGameObject(scene, obj, resources);
53 });
54 bindGameObject["update"] = &obe::Script::GameObject::update;
55 bindGameObject["deleteObject"] = &obe::Script::GameObject::deleteObject;
56 bindGameObject["access"] = &obe::Script::GameObject::access;
57 bindGameObject["getConstructor"] = &obe::Script::GameObject::getConstructor;
58 bindGameObject["initialize"] = &obe::Script::GameObject::initialize;
59 bindGameObject["setPermanent"] = &obe::Script::GameObject::setPermanent;
60 bindGameObject["isPermanent"] = &obe::Script::GameObject::isPermanent;
61 bindGameObject["getEnvironment"] = &obe::Script::GameObject::getEnvironment;
62 bindGameObject["setState"] = &obe::Script::GameObject::setState;
63 bindGameObject["dump"] = &obe::Script::GameObject::dump;
64 bindGameObject["load"] = &obe::Script::GameObject::load;
65 bindGameObject["deletable"] = &obe::Script::GameObject::deletable;
66 }
67 void LoadClassGameObjectDatabase(sol::state_view state)

Callers

nothing calls this directly

Calls 4

propertyFunction · 0.85
overloadFunction · 0.85
useTriggerMethod · 0.80
loadGameObjectMethod · 0.80

Tested by

no test coverage detected