ScriptComponents.h 605 B

1234567891011121314151617181920212223
  1. #ifndef __COMPONENTS__SCRIPT_COMPONENT_H__
  2. #define __COMPONENTS__SCRIPT_COMPONENT_H__
  3. #include <pybind11/pybind11.h>
  4. #include <string>
  5. #include <memory>
  6. namespace py = pybind11;
  7. struct ScriptComponent
  8. {
  9. std::string scriptModule; // e.g. "enemy_ai" (without .py)
  10. std::string scriptClass; // e.g. "EnemyAI"
  11. py::object instance // Holds the live Python object
  12. bool initialized = false;
  13. ScriptComponent() = default;
  14. ScriptComponent(const std::string& moduleName, const std::string& className)
  15. : scriptModule(moduleName), scriptClass(className) {}
  16. };
  17. #endif