]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Uses bitmask function to set bit
authorIsraël Hallé <israel.halle@shopify.com>
Mon, 4 Aug 2014 20:03:32 +0000 (16:03 -0400)
committerIsraël Hallé <israel.halle@shopify.com>
Tue, 5 Aug 2014 03:44:01 +0000 (23:44 -0400)
entityx/Entity.h

index e4192dbedb2a60632998ea84ed71981cfb803814..7312e25943698055b19905db9416be0b4484b3df 100644 (file)
@@ -506,7 +506,7 @@ class EntityManager : entityx::help::NonCopyable {
     Pool<C> *pool = accomodate_component<C>();
     new(pool->get(id.index())) C(std::forward<Args>(args) ...);
     ComponentHandle<C> component(this, id);
-    entity_component_mask_[id.index()] |= uint64_t(1) << family;
+    entity_component_mask_[id.index()].set(family);
     event_manager_.emit<ComponentAddedEvent<C>>(Entity(this, id), component);
     return component;
   }
@@ -524,7 +524,7 @@ class EntityManager : entityx::help::NonCopyable {
     ComponentHandle<C> component(this, id);
     BasePool *pool = component_pools_[family];
     event_manager_.emit<ComponentRemovedEvent<C>>(Entity(this, id), component);
-    entity_component_mask_[id.index()] &= ~(uint64_t(1) << family);
+    entity_component_mask_[id.index()].reset(family);
     pool->destroy(index);
   }