SDK: Allow to set an update order for systems (Closes #106)

This commit is contained in:
Jérôme Leclercq
2016-11-08 02:51:25 +01:00
parent 4570f9a6e1
commit aa304ef2e9
6 changed files with 97 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ namespace Ndk
class NDK_API World : public Nz::HandledObject<World>
{
friend BaseSystem;
friend Entity;
public:
@@ -72,6 +73,8 @@ namespace Ndk
private:
inline void Invalidate();
inline void Invalidate(EntityId id);
inline void InvalidateSystemOrder();
void ReorderSystems();
struct EntityBlock
{
@@ -87,11 +90,13 @@ namespace Ndk
};
std::vector<std::unique_ptr<BaseSystem>> m_systems;
std::vector<BaseSystem*> m_orderedSystems;
std::vector<EntityBlock> m_entities;
std::vector<EntityId> m_freeIdList;
EntityList m_aliveEntities;
Nz::Bitset<Nz::UInt64> m_dirtyEntities;
Nz::Bitset<Nz::UInt64> m_killedEntities;
bool m_orderedSystemsUpdated;
};
}