You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
607 B
36 lines
607 B
#ifndef NATIVE_SCRIPT_H |
|
#define NATIVE_SCRIPT_H |
|
|
|
#include "inferno/scene/scene.h" |
|
|
|
namespace Inferno { |
|
|
|
struct TransformComponent; |
|
|
|
class NativeScript { |
|
public: |
|
virtual ~NativeScript() {} |
|
|
|
protected: |
|
virtual void initialize() {} |
|
virtual void destroy() {} |
|
virtual void update(float deltaTime) { (void)deltaTime; } |
|
|
|
template<typename T> |
|
T& getComponent() const |
|
{ |
|
return m_scene->getComponent<T>(m_entity); |
|
} |
|
|
|
TransformComponent* transform { nullptr }; |
|
|
|
private: |
|
Scene* m_scene { nullptr }; |
|
uint32_t m_entity { 0 }; |
|
|
|
friend class ScriptSystem; |
|
}; |
|
|
|
} |
|
|
|
#endif // NATIVE_SCRIPT_H
|
|
|