Platformer
Platformer
ScriptComponent.hpp
1 #ifndef SCRIPT_COMPONENT_HPP
2 #define SCRIPT_COMPONENT_HPP
3 
4 #include <pybind11/pybind11.h>
5 
6 #include "Component.hpp"
7 
9 class ScriptComponent : public Component {
10  public:
11 
14  const std::string& module,
16  const std::string& pyClass);
17 
18  void Init() override;
19 
20  void Update() override;
21 
23  const std::string moduleName;
25  const std::string className;
26 
27  private:
29  pybind11::object wrapper_;
30 };
31 
32 #endif
pybind11::object wrapper_
The wrapper object for this script component.
Definition: ScriptComponent.hpp:29
const std::string moduleName
The name of this script component&#39;s python module.
Definition: ScriptComponent.hpp:23
void Init() override
Initializes this component.
Definition: ScriptComponent.cpp:12
void Update() override
Updates this component.
Definition: ScriptComponent.cpp:26
A class for attaching python scripts as components.
Definition: ScriptComponent.hpp:9
Class representing a component of a GameObject.
Definition: Component.hpp:12
const std::string className
The name of this script component&#39;s python class.
Definition: ScriptComponent.hpp:25
ScriptComponent(const std::string &module, const std::string &pyClass)
Construts a new script component.
Definition: ScriptComponent.cpp:7