From: Stephen Seo Date: Fri, 3 Nov 2017 08:11:20 +0000 (+0900) Subject: Add getCurrentSize and getCurrentCapacity X-Git-Tag: 1.0~65 X-Git-Url: https://git.seodisparate.com/stephenseo/static/search/searchdata.js?a=commitdiff_plain;h=d809d34716eb9db854c6d145136bfca251b37438;p=EntityComponentMetaSystem Add getCurrentSize and getCurrentCapacity --- diff --git a/src/EC/Manager.hpp b/src/EC/Manager.hpp index b2e50ac..a29ec58 100644 --- a/src/EC/Manager.hpp +++ b/src/EC/Manager.hpp @@ -157,6 +157,29 @@ namespace EC return hasEntity(index) && std::get(entities.at(index)); } + /*! + \brief Returns the current size or number of entities in the system. + + Note that this size includes entities that have been marked for + deletion but not yet cleaned up by the cleanup function. + */ + std::size_t getCurrentSize() const + { + return currentSize; + } + + /* + \brief Returns the current capacity or number of entities the system + can hold. + + Note that when capacity is exceeded, the capacity is increased by + EC_GROW_SIZE_AMOUNT. + */ + std::size_t getCurrentCapacity() const + { + return currentCapacity; + } + /*! \brief Returns a const reference to an Entity's info.