Rework ECS framework
- Add queue systems when adding/removing components and systems - Add GlobalData to ECSManager, used to store data that is not specific to entities - Add View class, used to for loop all entities that contains the given Components - Rework how signaling works
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Copium
|
||||
return id != entity.id;
|
||||
}
|
||||
|
||||
Entity::operator bool() const
|
||||
bool Entity::IsValid() const
|
||||
{
|
||||
if (id == INVALID_ENTITY)
|
||||
return false;
|
||||
@@ -49,6 +49,11 @@ namespace Copium
|
||||
return false;
|
||||
}
|
||||
|
||||
Entity::operator bool() const
|
||||
{
|
||||
return IsValid();
|
||||
}
|
||||
|
||||
void Entity::Invalidate()
|
||||
{
|
||||
id = INVALID_ENTITY;
|
||||
@@ -79,4 +84,4 @@ namespace Copium
|
||||
{
|
||||
return {manager, manager->CreateEntity()};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user