Platformer
Platformer
Public Member Functions | Public Attributes | Private Attributes | List of all members
ScriptComponent Class Reference

A class for attaching python scripts as components. More...

#include <ScriptComponent.hpp>

Inheritance diagram for ScriptComponent:
Inheritance graph
Collaboration diagram for ScriptComponent:
Collaboration graph

Public Member Functions

 ScriptComponent (const std::string &module, const std::string &pyClass)
 Construts a new script component. More...
 
void Init () override
 Initializes this component.
 
void Update () override
 Updates this component.
 
- Public Member Functions inherited from Component
void SetParentGameObject (std::weak_ptr< GameObject > g)
 Sets the given GameObject as this component's parent. More...
 
std::shared_ptr< GameObjectGetGameObject ()
 Gets a shared ptr reference to this component's GameObject. More...
 

Public Attributes

const std::string moduleName
 The name of this script component's python module. More...
 
const std::string className
 The name of this script component's python class. More...
 

Private Attributes

pybind11::object wrapper_
 The wrapper object for this script component. More...
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::weak_ptr< GameObjectgameObject
 This component's parent GameObject.
 

Detailed Description

A class for attaching python scripts as components.

Constructor & Destructor Documentation

◆ ScriptComponent()

ScriptComponent::ScriptComponent ( const std::string &  module,
const std::string &  pyClass 
)

Construts a new script component.

Parameters
moduleThe name of this script component's python module.
pyClassThe name of this script component's python class.

Member Data Documentation

◆ className

const std::string ScriptComponent::className

The name of this script component's python class.

◆ moduleName

const std::string ScriptComponent::moduleName

The name of this script component's python module.

◆ wrapper_

pybind11::object ScriptComponent::wrapper_
private

The wrapper object for this script component.


The documentation for this class was generated from the following files: