Unity Assets from Kronnect

Grid Systems (Terrain, 2D, Hexasphere) => Feature Requests => Topic started by: manofspirit on August 15, 2019, 04:21:57 PM

Title: CellGetNeighbours use Cached Indeces Array for performance like CellGetFromGroup
Post by: manofspirit on August 15, 2019, 04:21:57 PM
Hi there,

CellGetFromGroup takes indeces array for optimization which is great
int CellGetFromGroup (int group, int[] indices)

Please provide a similar method for CellGetNeighbours that takes int[] indices array instead returning a new List every call.

Thanks
Title: Re: CellGetNeighbours use Cached Indeces Array for performance like CellGetFromGroup
Post by: Kronnect on August 17, 2019, 10:44:01 AM
Added overloads to CellGetNeighbour to accept List<int> parameters.
Title: Re: CellGetNeighbours use Cached Indeces Array for performance like CellGetFromGroup
Post by: manofspirit on August 17, 2019, 12:21:46 PM
Thank you for adding this to recent beta however there is a minor conflict
CellGetFromGroup uses int[] while CellNeighbours is using List<int>

So it'd be great if we use same code cached indeces for both whether List or array so we can reuse same datatype for both.

Thanks
Title: Re: CellGetNeighbours use Cached Indeces Array for performance like CellGetFromGroup
Post by: Kronnect on August 18, 2019, 01:51:41 AM
Done. A new overload for CellGetFromGroup has been added which uses a List<int> as well.
Title: Re: CellGetNeighbours use Cached Indeces Array for performance like CellGetFromGroup
Post by: manofspirit on August 19, 2019, 04:54:42 AM
Done. A new overload for CellGetFromGroup has been added which uses a List<int> as well.

Awesome :)