Sdk/BaseSystem: Reuse EntityList

This commit is contained in:
Lynix
2017-04-21 01:02:46 +02:00
parent 53b92106ff
commit 203509f141
4 changed files with 54 additions and 26 deletions

View File

@@ -21,6 +21,8 @@ namespace Ndk
using size_type = std::size_t;
inline EntityList();
inline EntityList(const EntityList& entityList);
inline EntityList(EntityList&& entityList) noexcept;
~EntityList() = default;
inline void Clear();
@@ -33,11 +35,14 @@ namespace Ndk
inline void Remove(Entity* entity);
// STL API
inline iterator begin();
inline iterator begin() const;
inline bool empty() const;
inline iterator end();
inline iterator end() const;
inline size_type size() const;
inline EntityList& operator=(const EntityList& entityList);
inline EntityList& operator=(EntityList&& entityList) noexcept;
private:
inline std::size_t FindNext(std::size_t currentId) const;
inline World* GetWorld() const;
@@ -46,7 +51,7 @@ namespace Ndk
World* m_world;
};
class EntityList::iterator : public std::iterator<std::forward_iterator_tag, const EntityHandle>
class NDK_API EntityList::iterator : public std::iterator<std::forward_iterator_tag, const EntityHandle>
{
friend EntityList;