Skip to content

Entity References and Serialization

Adrian Papari edited this page Jun 5, 2016 · 13 revisions

Entity references as shown below can be safely serialized. This feature is only for serialization, and the EntityLinkManager - since 2.0.0-RC1. EntityLinkManager can be configured to protect your references from dangling when entities go out of scope.

Valid entity references:

public class Parent extends Component  {
    public Entity entity;
    public Bag<Entity> entities = new Bag<>();

    @EntityId public int parentId;
    @EntityId public IntBag entityIds = new IntBag();  
}
Clone this wiki locally