Sdk/EntityList: Automatically remove entities from lists on destruction

This commit is contained in:
Lynix
2017-05-14 22:13:31 +02:00
parent 3d25501f9f
commit bb3eebb9cc
6 changed files with 81 additions and 22 deletions

View File

@@ -15,6 +15,8 @@ namespace Ndk
{
class NDK_API EntityList
{
friend Entity;
public:
class iterator;
friend iterator;
@@ -23,7 +25,7 @@ namespace Ndk
inline EntityList();
inline EntityList(const EntityList& entityList);
inline EntityList(EntityList&& entityList) noexcept;
~EntityList() = default;
inline ~EntityList();
inline void Clear();
@@ -46,6 +48,7 @@ namespace Ndk
private:
inline std::size_t FindNext(std::size_t currentId) const;
inline World* GetWorld() const;
inline void NotifyEntityDestruction(const Entity* entity);
Nz::Bitset<Nz::UInt64> m_entityBits;
World* m_world;