entity destruction, etc.

This commit is contained in:
2026-03-15 19:22:20 +01:00
parent 2983b919cd
commit d522881358
6 changed files with 101 additions and 47 deletions

View File

@@ -23,13 +23,14 @@ namespace Game::Object {
Entity& operator=(const Entity&);
Entity(Entity&&) noexcept;
Entity& operator=(Entity&&) noexcept;
virtual ~Entity() = 0;
virtual ~Entity() = 0; // Destructor
// Start is called when the entity is spawned
virtual void start() = 0;
// Update is called every update cycle; deltaTime is the time (in seconds) since the last update call
virtual void update(float deltaTime) = 0;
virtual void onWindowResized(int newWidth, int newHeight) {} // Called when the window is resized, with the new width and height in pixels
virtual void destroyed() {}; // Pre-destruction call
void render(Game::Renderer::Renderer* renderer, Game::Renderer::RendererConfig config);
// Setters and getters