yellowstonegames / SquidLib

Useful tools for roguelike, role-playing, strategy, and other grid-based games in Java. Feedback is welcome!
Other
454 stars 46 forks source link

Reduce allocations in FOV by reusing the previously returned array + … #133

Closed smelc closed 7 years ago

smelc commented 7 years ago

…simplify Rectangle.Utils::getBorder's implementation (@tettinger I took mine over yours, as it was a bit simpler, otherwise I took your code in Rectangle, so the diff is mainly noise) + add classical 'gimme an ArrayList' buffer to shuffle method in RNG

I finally merged the main branch into my fork, so welcome back mergeable PRs :-)

tommyettinger commented 7 years ago

Good stuff, except the fill() methods in DungeonUtility are almost identical to the fill2D methods in GwtCompatibility. Since GwtCompatibility is not where they should be anyway (but neither is DungeonUtility, since they aren't just for dungeons), maybe the various 2D array handling code for simple methods like that should be put into one "Utility2D" class or something. I'll pull this and hope to continue some discussion about the organization.