z_mirror/PipeVisualizer
git clone https://git.raiguard.me/z_mirror/PipeVisualizer
9371b54
2.0
1local util ={} 2 3--- Iterates the fluid system IDs of the given fluidbox. 4--- @param fluidbox LuaFluidBox 5--- @return fun(): uint?, FluidSystemID? 6function util . iterate_fluid_systems ( fluidbox ) 7--- @type uint 8local fluidbox_index =0 9--- @type uint 10local limit =# fluidbox 11local get_id =fluidbox . get_fluid_system_id 12return function () 13--- @type FluidSystemID 14local id 15while not id do 16if fluidbox_index == limit then 17return 18end 19fluidbox_index =fluidbox_index + 1 20id =get_id ( fluidbox_index ) 21end 22return fluidbox_index , id 23end 24end 25 26return util