Yes, pooled components are always reused. Deleting an entity invokes the deleted(Entity) method on all EntitySystems and Managers. The ComponentManager reclaims/removes all affected components during .
More behind the scenes: upon encountering a component type for the first time, a for said component is created which - among some other things - checks whether the component extends Component, PooledComponent or PackedComponent.
When a component is removed or an entity deleted, the ComponentType associated with the component is queried about its taxonomy (basic, pooled, packed). Pooled components are returned/obtained from the (or, if the pool hasn't recycled any components, a new instance is returned).
Since you're somewhat new to java: - I'm assuming you haven't set up your project as a maven project, but if you have: the @PooledComponent annotation can automatically transform components into PooledComponent via the artemis-odb-maven-plugin. - There's a slight performance hit from using PooledComponents - unless you're creating a ton of components (>1000/s), you're probably better off using normal components. On android/dalvik however, GC pauses can cause a lot of micro stutter - which can be alleviated to some extent by using pooled components.
_________________ : bytecode-weaving antiboilerplate lib for artemis. | : bugfixing and performance optimized fork.
|