]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Debug -> All, now that it is faster.
authorAlec Thomas <alec@swapoff.org>
Thu, 23 Oct 2014 03:33:50 +0000 (14:33 +1100)
committerAlec Thomas <alec@swapoff.org>
Thu, 23 Oct 2014 03:33:50 +0000 (14:33 +1100)
entityx/Entity.h

index c3fdbeee2bfe947474bf519570e2d72b70455701..e5c748078821b4c606e7ab6afc6c665eb5aff98d 100644 (file)
@@ -324,8 +324,8 @@ class EntityManager : entityx::help::NonCopyable {
   virtual ~EntityManager();
 
   /// An iterator over a view of the entities in an EntityManager.
-  /// If Debug is true it will iterate over all valid entities and will ignore the entity mask.
-  template <class Delegate, bool Debug = false>
+  /// If All is true it will iterate over all valid entities and will ignore the entity mask.
+  template <class Delegate, bool All = false>
   class ViewIterator : public std::iterator<std::input_iterator_tag, Entity::Id> {
    public:
     Delegate &operator ++() {
@@ -341,14 +341,14 @@ class EntityManager : entityx::help::NonCopyable {
    protected:
     ViewIterator(EntityManager *manager, uint32_t index)
         : manager_(manager), i_(index), capacity_(manager_->capacity()) {
-      if (Debug) {
+      if (All) {
         manager_->free_list_.sort();
         free_cursor_ = manager_->free_list_.begin();
       }
     }
     ViewIterator(EntityManager *manager, const ComponentMask mask, uint32_t index)
         : manager_(manager), mask_(mask), i_(index), capacity_(manager_->capacity()) {
-      if (Debug) {
+      if (All) {
         manager_->free_list_.sort();
         free_cursor_ = manager_->free_list_.begin();
       }
@@ -366,7 +366,7 @@ class EntityManager : entityx::help::NonCopyable {
     }
 
     inline bool predicate() {
-      return (Debug && valid_entity()) || (manager_->entity_component_mask_[i_] & mask_) == mask_;
+      return (All && valid_entity()) || (manager_->entity_component_mask_[i_] & mask_) == mask_;
     }
 
     inline bool valid_entity() {
@@ -384,15 +384,15 @@ class EntityManager : entityx::help::NonCopyable {
     std::list<uint32_t>::iterator free_cursor_;
   };
 
-  template <bool Debug>
+  template <bool All>
   class BaseView {
   public:
-    class Iterator : public ViewIterator<Iterator, Debug> {
+    class Iterator : public ViewIterator<Iterator, All> {
     public:
       Iterator(EntityManager *manager,
         const ComponentMask mask,
-        uint32_t index) : ViewIterator<Iterator, Debug>(manager, mask, index) {
-        ViewIterator<Iterator, Debug>::next();
+        uint32_t index) : ViewIterator<Iterator, All>(manager, mask, index) {
+        ViewIterator<Iterator, All>::next();
       }
 
       void next_entity(Entity &entity) {}