SDK/Entity: Delay component removal until world update
Allows system to freely remove components while updating Former-commit-id: f567d3344f764a0909abc2c4a8f69a580aa585b3 [formerly 77379f40a7773443420058a342dec4c02e563053] [formerly 1313a164a686c915c8c54e1dfb367757499b45e9 [formerly f69b0a2a5fd0c3a640c19409baa3f467d231b566]] Former-commit-id: 19aeaebcb33056b67e788d5ef485179ed17b2fd8 [formerly fe85c2fcf3851834f70d0573617a15be31e02e50] Former-commit-id: 527c9fd9571f405b0963123c158ef1e4b42f28ad
This commit is contained in:
@@ -103,12 +103,31 @@ namespace Ndk
|
||||
RemoveComponent(index);
|
||||
}
|
||||
|
||||
inline void Entity::RemoveAllComponents()
|
||||
{
|
||||
m_removedComponentBits = m_componentBits;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
inline void Entity::RemoveComponent(ComponentIndex index)
|
||||
{
|
||||
m_removedComponentBits.UnboundedSet(index);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
inline Nz::String Entity::ToString() const
|
||||
{
|
||||
Nz::StringStream ss;
|
||||
return ss << "Entity(" << GetId() << ')';
|
||||
}
|
||||
|
||||
inline Nz::Bitset<>& Entity::GetRemovedComponentBits()
|
||||
{
|
||||
return m_removedComponentBits;
|
||||
}
|
||||
|
||||
inline void Entity::RegisterSystem(SystemIndex index)
|
||||
{
|
||||
m_systemBits.UnboundedSet(index);
|
||||
|
||||
Reference in New Issue
Block a user