Continue implementation of Entity::AddComponent()

This commit is contained in:
Maple Redleaf
2025-11-10 11:17:47 -06:00
parent 9d9a574b87
commit 3c309da421
2 changed files with 7 additions and 1 deletions

View File

@@ -6,7 +6,7 @@
class Entity {
public:
template <typename CompT, typename... Args>
CompT *AddComponent(Args &&...args);
Component *AddComponent(Args &&...args);
void Init();
void Draw();

View File

@@ -1,3 +1,9 @@
#pragma once
#ifndef VOID_ENTITY_H
#include "../include/entity.h"
#endif
template <typename CompT, typename... Args>
Component *Entity::AddComponent(Args &&...args) {
return components.emplace_back(std::forward<Args>(args)...);
}