Hey guys :)
I have been working on an MMORPG for the sole purpose of education recently because i want to start computer science at University in a couple of years and be really prepared for it (i'm only 17 this year)
So far i have basically all the networking sorted and am working on an objects system -- i want to make my own which goes like this:
There is an array for every field in an object
The index of the array (for example array[index]=x) is equivelant to the user index ID
I have some functions which go like this:
storeObject(name of the array to store in, data to store, user index);
readObject(name of the array, user index);
newObject(name of new array to be created, max values);
As you can see all functions above require me to use the parameter (which is a String) to call the array - the problem is just how do i do this?
consider this (i know it's completely wrong, i need major help)
storeObject(String na, String da1, int uidx) {
na[uidx] = da1;
}
How would i do that? To be more precise, how would i use the value of the string na be the name of the array which we are going to store in, and use it like above?
Thank you so much for your assistance! Every piece of advice is appreciated. If you have any critisism on my object system and would recommend an easier or more efficient method for use in threads and multiple classes on a server and client in an MMORPG please let me know :)
-Ollie