diff options
author | Israël Hallé <israel.halle@shopify.com> | 2014-08-04 16:03:32 -0400 |
---|---|---|
committer | Israël Hallé <israel.halle@shopify.com> | 2014-08-04 23:44:01 -0400 |
commit | 84a899775b86a1e44b2327cb35ef45a393f161d6 (patch) | |
tree | 7fabe5c26cc172dabb5ec5b66613878534dc874e | |
parent | 7df7437e2dc433902c1ea7a20520a7562c426e34 (diff) |
Uses bitmask function to set bit
-rw-r--r-- | entityx/Entity.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/entityx/Entity.h b/entityx/Entity.h index e4192db..7312e25 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -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); } |