I'm trying to create a space sim.
I'm using arrays of types to store all data about the spacestations and other stuff.
When I have a sector that has only 4 stations, I will use an arrays with indexes 1-4.
I want the ability to let the player build his own stations later on.
But then I should need to increase the array's indexes, so it can hold the existing data and add one more.
How would I do that?
Should I create a second (temporary) array and copy all data to this new array, then redim the original array (with one more index) and copy all data back to it?
As redimming an array clears all data that's in it.
I could also preset a certain maximum to it, but then the player is limited to these settings.
I'm using arrays of types to store all data about the spacestations and other stuff.
When I have a sector that has only 4 stations, I will use an arrays with indexes 1-4.
I want the ability to let the player build his own stations later on.
But then I should need to increase the array's indexes, so it can hold the existing data and add one more.
How would I do that?
Should I create a second (temporary) array and copy all data to this new array, then redim the original array (with one more index) and copy all data back to it?
As redimming an array clears all data that's in it.
I could also preset a certain maximum to it, but then the player is limited to these settings.