MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers
21 stars 4 forks source link

Refactor tile getNeighbor functions #356

Closed LordMidas closed 3 months ago

LordMidas commented 3 months ago

As per discussion on Discord. These features which were added for the 1.3.0 build before release are being changed. Reasoning being:

  1. Remove _function because the native filter can be used on the returned array. And performance isn't a concern.
  2. Remove getNeighbor as it was returning the first valid neighbor. But that can be achieved in other ways and is a niche application.
  3. Remove getRandomNeighbor as that can simply be achieved via ::MSU.Array.rand on getNeighbors.