A small game engine for 2D games based of Raylib
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.

18 rivejä
399 B

5 kuukautta sitten
  1. #pragma once
  2. #include <chrono>
  3. namespace ant::core {
  4. struct entity;
  5. struct component {
  6. virtual std::string name() = 0;
  7. virtual void initialize() {}
  8. virtual void render() {}
  9. virtual void update(std::chrono::duration<double>) {}
  10. [[nodiscard]] auto owner() -> std::shared_ptr<entity> {
  11. return m_owner.lock();
  12. }
  13. private:
  14. std::weak_ptr<entity> m_owner;
  15. friend struct entity;
  16. };
  17. }