I have a custom struct for a world tile in an iOS game. I want to store multiple WorldTile
s in an array but am not sure what the most efficient way is. It's an infinite-map style game and I'm loading only chunks around the player, so I want the fastest way of storing the data.
I could store this in a c-based multidimensional array (WorldTile tiles[16][16]
) but I don't see a way to make it an @property
for easier access outside the class, or I could wrap this using NSValue
and store in an NSArray
but that seems like overhead I don't need.
typedef struct {
b2Vec2 coord;
float height;
float temperature;
} WorldTile;
How can I either store the multi-dimensional array as an @property
, or is the performance cost of wrapping it with an NSValue not a big deal?