Code: Select all
surface.clone_entities(
{
entities (array of Entity to clone)
destination_offset (Vector, how far to move the entities)
destination_surface (SurfaceSpecification, optional, defaults to the same surface)
})
It should return an array of Entity with the same indexes as the array that was passed into the function, with nils (or maybe false so that the # operator works?) where entities could not be cloned.
on_entity_cloned should be raised for each entity that was cloned.
Additionally, parameters similar to find_entities_filtered could be added to find the entities/tiles, which would essentially combine surface.clone_multiple({ entities = surface.find_entities_filtered({ ... }), ... }) into a single API call. However the overhead of cloning a bunch of entities is going to far outweigh the additional API call so it really isn't necessary.
ps: thx 4 on_entity_cloned