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.
39 lines
618 B
39 lines
618 B
/* |
|
* Copyright (C) 2022 Riyyi |
|
* |
|
* SPDX-License-Identifier: MIT |
|
*/ |
|
|
|
#pragma once |
|
|
|
#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; |
|
}; |
|
|
|
} // namespace Inferno
|
|
|