|
|
- #pragma once
-
- #include <chrono>
-
- namespace ant::core {
- struct entity;
- struct component {
- virtual std::string name() = 0;
- virtual void initialize() {}
- virtual void render() {}
- virtual void update(std::chrono::duration<double>) {}
- [[nodiscard]] auto owner() -> std::shared_ptr<entity> {
- return m_owner.lock();
- }
- private:
- std::weak_ptr<entity> m_owner;
- friend struct entity;
- };
- }
|