public static Entity RemapEntity(EntityRemapInfo *remapping, Entity source) { if (source.Version == remapping[source.Index].SourceVersion) { return(remapping[source.Index].Target); } else { // When moving whole worlds, we do not allow any references that aren't in the new world // to avoid any kind of accidental references return(Entity.Null); } }
internal static void PatchEntityInBoxedType(object container, EntityRemapInfo *remapInfo) { var visitor = new EntityRemappingVisitor(remapInfo); var changeTracker = new ChangeTracker(); var type = container.GetType(); var resolved = PropertyBagResolver.Resolve(type); if (resolved != null) { resolved.Accept(ref container, ref visitor, ref changeTracker); } else { throw new ArgumentException($"Type '{type.FullName}' not supported for visiting."); } }
public EntityRemappingVisitor(EntityRemapInfo *remapInfo) { AddAdapter(new EntityRemappingAdapter(remapInfo)); }
public EntityRemappingAdapter(EntityRemapInfo *entityRemapInfo) { _EntityRemapInfo = entityRemapInfo; }
internal static void PatchEntityInBoxedType(object container, EntityRemapInfo *remapInfo) { PropertyContainer.Visit(container, new EntityRemappingVisitor(remapInfo)); }