Added Reserve function in Ndk::EntityList (#134)

This commit is contained in:
S6066 2017-09-03 18:11:28 +00:00 committed by Jérôme Leclercq
parent 5915b6ce3a
commit 9f52932327
2 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ namespace Ndk
inline void Insert(Entity* entity);
inline void Remove(Entity* entity);
inline void Reserve(std::size_t entityCount);
// STL API
inline iterator begin() const;

View File

@ -137,6 +137,16 @@ namespace Ndk
}
}
/*!
* \brief Reserves enough space to contains entityCount entities
*
* \param entityCount Number of entities to reserve
*/
inline void EntityList::Reserve(std::size_t entityCount)
{
m_entityBits.Reserve(entityCount);
}
// STL Interface
inline EntityList::iterator EntityList::begin() const
{