]> git.seodisparate.com - EntityComponentMetaSystem/commitdiff
Add getCurrentSize and getCurrentCapacity
authorStephen Seo <seo.disparate@gmail.com>
Fri, 3 Nov 2017 08:11:20 +0000 (17:11 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 3 Nov 2017 08:11:20 +0000 (17:11 +0900)
src/EC/Manager.hpp

index b2e50acc2a6edcaadbe4fbcab5b66b791d4fda24..a29ec58241ce2dd34cd2100f5bc20d43f581fb4a 100644 (file)
@@ -157,6 +157,29 @@ namespace EC
             return hasEntity(index) && std::get<bool>(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.