|
|
@ -50,6 +50,15 @@ public class EntityBuilder |
|
|
|
public EntityBuilder(World world, EntityPath? path = null) |
|
|
|
public EntityBuilder(World world, EntityPath? path = null) |
|
|
|
{ World = world; Path = path; } |
|
|
|
{ World = world; Path = path; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public EntityBuilder(World world, Entity parent, EntityPath? path = null) |
|
|
|
|
|
|
|
: this(world, path) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// If given path is absolute, the new entity won't be created as a |
|
|
|
|
|
|
|
// child of the specified parent. Alternatively, EntityRef.NewChild |
|
|
|
|
|
|
|
// can be used, which will throw when an absolute path is given. |
|
|
|
|
|
|
|
if ((path?.IsRelative != false) && parent.IsSome) ChildOf(parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override EntityBuilder Add(Id id) |
|
|
|
public override EntityBuilder Add(Id id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// If adding a ChildOf relation, store the parent separately. |
|
|
|
// If adding a ChildOf relation, store the parent separately. |
|
|
|