fabio-t / alone-rl

A free to use, survival open-world roguelike game
GNU Affero General Public License v3.0
38 stars 2 forks source link

Map should take a lambda? #17

Open fabio-t opened 6 years ago

fabio-t commented 6 years ago

Must investigate whether I should pass a lambda to map functions, or even better how to make it a Stream so that I can use functional-style filter/fold/map functions.

fabio-t commented 6 years ago

The big use case is selecting only a subset of the surrounding entities; using a filter would save a lot of code and quite possibly computation (since right now we first collect all visible entities around, and then iterate over them again to select a few).