redruin1 / factorio-draftsman

A complete, well-tested, and up-to-date module to manipulate Factorio blueprint strings. Compatible with mods.
MIT License
94 stars 17 forks source link

A number of functions are not recursive and will not perform the action on any contained Groups #33

Closed elswindle closed 2 years ago

elswindle commented 2 years ago

This may be an intended functionality and the burden will be on the user to do this, but there are a few functions that do not perform the action on the Group objects inside. The two I noticed are remove_power_connections and entities.remove. These will just perform the function on any EntityLike in the list, but not call the corresponding Group function on its entities.

redruin1 commented 2 years ago

For remove_power_connections() and remove_circuit_connections(), they now recurse through all subgroups, following their descriptions that they remove ALL power/circuit connections.

entities.remove() is a little less clear-cut; it seems to me that there are valid use cases for having it recurse as well as having it be limited to just the called EntityList. Therefore, I've decided that entities.remove() will remain unchanged, while entities.recursive_remove() will provide this functionality, while being more explicit in both cases as to what exactly is going on. I'll probably follow this naming scheme for other EntityList operations, as appropriate.

redruin1 commented 2 years ago

Fixed/Added as of version 1.0.0.