Anvil Engine
Loading...
Searching...
No Matches
IComponent.h
Go to the documentation of this file.
1#pragma once
2#include "ACore.h"
3
4class AEntity;
5class AShader;
6
12{
13 public:
18 virtual ~IComponent()
19 {
20 }
21
25 virtual void OnInit(AEntity* owner) = 0;
30 virtual void OnUpdate(float dt) = 0;
35 virtual void OnRender(AShader* shader) = 0;
40 AEntity* m_owner = nullptr;
41};
float dt
Definition Main.cpp:10
#define ANVIL_API
Definition ACore.h:6
Represents an entity in the game engine with position, rotation, scale and components.
Definition AEntity.h:16
Definition AShader.h:8
The IComponent class is an abstract base class that defines the interface for all components in the A...
Definition IComponent.h:12
AEntity * m_owner
Pointer to the entity that owns this component. This allows the component to access its parent entity...
Definition IComponent.h:40
virtual void OnUpdate(float dt)=0
Called once per frame to update the component's state.
virtual void OnInit(AEntity *owner)=0
Called when the component is initialized.
virtual ~IComponent()
Virtual destructor for the IComponent class. Ensures proper cleanup of derived class objects when del...
Definition IComponent.h:18
virtual void OnRender(AShader *shader)=0
Called to render the component.