A small game engine for 2D games based of Raylib
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 

19 rader
399 B

#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;
};
}