]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Update README for 1.0.0.
authorAlec Thomas <alec@swapoff.org>
Mon, 29 Sep 2014 04:14:54 +0000 (14:14 +1000)
committerAlec Thomas <alec@swapoff.org>
Mon, 29 Sep 2014 04:14:54 +0000 (14:14 +1000)
README.md
entityx/Entity.h

index 9d767ca6b9fca1bd61a28cdfa7ba254ea67828ef..6223b8dbf78db27caa3ec17f73b905aa35870916 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # EntityX - A fast, type-safe C++ Entity Component System [![Build Status](https://travis-ci.org/alecthomas/entityx.png)](https://travis-ci.org/alecthomas/entityx)
 
-***NOTE: The current version 1.0.0alpha1 breaks backwards compataibility. See the [change log](CHANGES.md) for details.***
+***NOTE: The current stable release 1.0.0 breaks backwards compataibility with < 1.0.0. See the [change log](CHANGES.md) for details.***
 
 Entity Component Systems (ECS) are a form of decomposition that completely decouples entity logic and data from the entity "objects" themselves. The [Evolve your Hierarchy](http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/) article provides a solid overview of EC systems and why you should use them.
 
index 6c452ac2d46bc1919aecfd9f393a2d54b04eec9d..28106151b929023a4bc26859d04f567046dff71f 100644 (file)
@@ -514,11 +514,16 @@ class EntityManager : entityx::help::NonCopyable {
   ComponentHandle<C> assign(Entity::Id id, Args && ... args) {
     assert_valid(id);
     const BaseComponent::Family family = C::family();
+
     // Placement new into the component pool.
     Pool<C> *pool = accomodate_component<C>();
     new(pool->get(id.index())) C(std::forward<Args>(args) ...);
-    ComponentHandle<C> component(this, id);
+
+    // Set the bit for this component.
     entity_component_mask_[id.index()].set(family);
+
+    // Create and return handle.
+    ComponentHandle<C> component(this, id);
     event_manager_.emit<ComponentAddedEvent<C>>(Entity(this, id), component);
     return component;
   }
@@ -533,10 +538,16 @@ class EntityManager : entityx::help::NonCopyable {
     assert_valid(id);
     const BaseComponent::Family family = C::family();
     const uint32_t index = id.index();
-    ComponentHandle<C> component(this, id);
+
+    // Find the pool for this component family.
     BasePool *pool = component_pools_[family];
+    ComponentHandle<C> component(this, id);
     event_manager_.emit<ComponentRemovedEvent<C>>(Entity(this, id), component);
+
+    // Remove component bit.
     entity_component_mask_[id.index()].reset(family);
+
+    // Call destructor.
     pool->destroy(index);
   }