#include <pythonscriptcomponent.h>
Public Member Functions | |
bool | init (utility::ErrorState &errorState) override |
virtual void | getDependentComponents (std::vector< rtti::TypeInfo > &components) const override |
![]() | |
virtual const rtti::TypeInfo | getInstanceType () const =0 |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
ResourcePtr< PythonScript > | mPythonScript = nullptr |
property: 'PythonScript' Pointer to a python script resource that manages the script that contains the python class for this component. More... | |
std::string | mClassName |
property: 'Class' The name of the class defined in the python script More... | |
std::vector< std::string > | mDependencies |
property: 'Dependencies' list of component types that need to be among this scripts siblings and that will be initialized before this component. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
The resource part of the PythonScriptComponent. Allows for running a python script inside a NAP application. The python script has to implement a class with the name of the ClassName property. The class should implement:
|
overridevirtual |
Populates a list of components this component depends on. Every component dependency, when found, is initialized before this component. A dependency is NOT a hard requirement. Serialization will not fail if the dependent component isn't declared in JSON. It only means that when a component is declared under the same entity, and that component is tagged as a dependency of this component, it is initialized before this component. It is your responsibility to return false on initialization if the dependency is a hard requirement and can't be found. To ensure the right order of initialization based on a hard requirement it is advised to use a nap::ComponentPtr instead.
components | list of component types this resource depends on. |
Reimplemented from Component.
|
overridevirtual |
Override this method to initialize the object after de-serialization. When called it is safe to assume that all dependencies have been resolved up to this point.
errorState | should contain the error message when initialization fails. |
Reimplemented from Object.
std::string mClassName |
property: 'Class' The name of the class defined in the python script
std::vector<std::string> mDependencies |
property: 'Dependencies' list of component types that need to be among this scripts siblings and that will be initialized before this component.
ResourcePtr<PythonScript> mPythonScript = nullptr |
property: 'PythonScript' Pointer to a python script resource that manages the script that contains the python class for this component.