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.
 

20 rivejä
417 B

#pragma once
#include <chrono>
#include <memory>
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;
};
}