Skip to content

Transferring an Entity

Elliot Ford edited this page Apr 9, 2015 · 5 revisions

What does an Entity transfer mean?

An Entity is held within an EntityContainer and this entity can be transferred to another container. Entities are also containers so this forms a tree structure and when an entity so this requires the ability to move an entity around without killing and re-creating it. The underlying EntityFactory controls all tree manipulation (including transfers) so the methods that can be used to achieve this will be explained.

Transferring the Entity

A transfer can be done by both Entity and EntityContainer.

Entity e = /* To transfer */
EntityContainer dest = /* Destination */

e.transfer(dest);

or

UUID id = /* ID of entity to transfer*/
EntityContainer src = /* Source*/
EntityContainer dest = /* Destination */

src.transferEntity(id, dest);

This transfer should really call container.receiveEntity(Entity) but it depends on the implementation (DefaultEntityContainer does).

Additional information

For more information see What is an EntityFactory.

Clone this wiki locally