That's also true, but when I have to edit some data in one field of a certain type-instance, I would have to loop through them all, just to edit one field.
Using an array, I can "group" all stations in a sector together (using the first index as the sector-number, the second as the station-number).
That way, I only have to loop through the second index of the array (if you have 100 sectors and 10 stations per sector), then you would have to loop through 1000 type-instances, instead of 10.
I'm trying all kinds of different approaches, but can't find the perfect solution.
And as long as I cannot find the perfect one, I cannot start with the game.
They should be:
- grouped together (so looping through them doesn't take too long)
- easy to use
- expandable, without re-compiling the entire EXE (I use textfiles to store all data)
- memory-efficient
Using an array, I can "group" all stations in a sector together (using the first index as the sector-number, the second as the station-number).
That way, I only have to loop through the second index of the array (if you have 100 sectors and 10 stations per sector), then you would have to loop through 1000 type-instances, instead of 10.
I'm trying all kinds of different approaches, but can't find the perfect solution.
And as long as I cannot find the perfect one, I cannot start with the game.
They should be:
- grouped together (so looping through them doesn't take too long)
- easy to use
- expandable, without re-compiling the entire EXE (I use textfiles to store all data)
- memory-efficient