diff --git a/src/World.cs b/src/World.cs index a26f243..9c14ad4 100644 --- a/src/World.cs +++ b/src/World.cs @@ -145,6 +145,14 @@ namespace MoonTools.ECS private Dictionary WorldToTransferID = new Dictionary(); + /// + /// If you are using the World Transfer feature, call this once after your systems/filters have all been initialized. + /// + public void PrepareTransferTo(World other) + { + other.FilterStorage.CreateMissingStorages(FilterStorage); + } + // FIXME: there's probably a better way to handle Filters so they are not world-bound public unsafe void Transfer(World other, Filter filter, Filter otherFilter) { @@ -152,10 +160,6 @@ namespace MoonTools.ECS other.ComponentDepot.CreateMissingStorages(ComponentDepot); other.RelationDepot.CreateMissingStorages(RelationDepot); - // FIXME: we could just do this once on startup - // Could have a PrepareTransfer method or something - other.FilterStorage.CreateMissingStorages(FilterStorage); - // destroy all entities matching the filter foreach (var entity in otherFilter.Entities) {