Initial editor commit

- Add Entity Tree View used to select entities to be modified
- Add Entity View used to Add/Remove/Edit Components of the Entity
- Add Asset View which lists all available assets
This commit is contained in:
Thraix
2023-07-18 11:58:55 +02:00
parent 65a86bd5a2
commit ca61bae014
22 changed files with 485 additions and 31 deletions
+17
View File
@@ -22,5 +22,22 @@ namespace Copium
virtual void RunEntity(Entity entity, Components&... components) {};
virtual void RunEntity(const Signal& signal, Entity entity, Components&... components) {};
// TODO: Not sure if this is the way entities should be validated
std::set<EntityId> loggedEntities;
template <typename... Components>
bool ValidateEntity(Entity entity)
{
if (entity && entity.HasComponents<Components...>())
{
loggedEntities.erase(entity);
return true;
}
if (loggedEntities.find(entity) == loggedEntities.end())
CP_WARN("Invalid Entity");
loggedEntities.emplace(entity);
return false;
}
};
}