From d809d34716eb9db854c6d145136bfca251b37438 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 3 Nov 2017 17:11:20 +0900 Subject: [PATCH] Add getCurrentSize and getCurrentCapacity --- src/EC/Manager.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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.