Skip to content

Commit 362e165

Browse files
committed
Update README for 1.0.0.
1 parent 96d5d0d commit 362e165

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# EntityX - A fast, type-safe C++ Entity Component System [![Build Status](https://travis-ci.org/alecthomas/entityx.png)](https://travis-ci.org/alecthomas/entityx)
22

3-
***NOTE: The current version 1.0.0alpha1 breaks backwards compataibility. See the [change log](CHANGES.md) for details.***
3+
***NOTE: The current stable release 1.0.0 breaks backwards compataibility with < 1.0.0. See the [change log](CHANGES.md) for details.***
44

55
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.
66

entityx/Entity.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,16 @@ class EntityManager : entityx::help::NonCopyable {
514514
ComponentHandle<C> assign(Entity::Id id, Args && ... args) {
515515
assert_valid(id);
516516
const BaseComponent::Family family = C::family();
517+
517518
// Placement new into the component pool.
518519
Pool<C> *pool = accomodate_component<C>();
519520
new(pool->get(id.index())) C(std::forward<Args>(args) ...);
520-
ComponentHandle<C> component(this, id);
521+
522+
// Set the bit for this component.
521523
entity_component_mask_[id.index()].set(family);
524+
525+
// Create and return handle.
526+
ComponentHandle<C> component(this, id);
522527
event_manager_.emit<ComponentAddedEvent<C>>(Entity(this, id), component);
523528
return component;
524529
}
@@ -533,10 +538,16 @@ class EntityManager : entityx::help::NonCopyable {
533538
assert_valid(id);
534539
const BaseComponent::Family family = C::family();
535540
const uint32_t index = id.index();
536-
ComponentHandle<C> component(this, id);
541+
542+
// Find the pool for this component family.
537543
BasePool *pool = component_pools_[family];
544+
ComponentHandle<C> component(this, id);
538545
event_manager_.emit<ComponentRemovedEvent<C>>(Entity(this, id), component);
546+
547+
// Remove component bit.
539548
entity_component_mask_[id.index()].reset(family);
549+
550+
// Call destructor.
540551
pool->destroy(index);
541552
}
542553

0 commit comments

Comments
 (0)