Currently it's quite inefficient to check which species matches criteria as it means allocating a Vec for every single species that exists and going though them one by one. A possible solutions could be something like this:
Which would just allocate everything once when it is first required and then keeps it allocated. This sacrifices memory usage for speed, but I think that it would be worth it.
Then to find matches you can just iterate over SPECIES_SPAWN_CONDITIONS and note down the species for the matches.
Currently it's quite inefficient to check which species matches criteria as it means allocating a Vec for every single species that exists and going though them one by one. A possible solutions could be something like this:
Which would just allocate everything once when it is first required and then keeps it allocated. This sacrifices memory usage for speed, but I think that it would be worth it.
Then to find matches you can just iterate over SPECIES_SPAWN_CONDITIONS and note down the species for the matches.