ok this is hard for me to explain... so im gonna break it up if i can...
(sorry for the long post)
im trying to make a game where data is loaded into mem for each different character
this memory i would like to have stored into an array of classes (Character)
then i would like to be able to make an array of instance classes or something similar to an array of child classes based on one index of each Character class, so this array of classes would probably have to be 2d (Player[ , ])
the player[ , ] class should be able to use the data loaded by the Character class like below:
player[0,0] and Player[0,1] should have access to the data loaded by Character
player[1,0] and Player[1,1] should have access to the data loaded by Character
Player[A,I] has access to Character[A]'s loaded data
Character[ ] - used to load and store the character data (model, texture, ect...)
Player[ , ] - keeps track of player values (x,y,z coordinates and weapon)
I Have the Character[ ] class made and working
Im basically trying to figure out how i could set this sort of thing up in c++
WHAT I WAS THINKING OF DOING... BUT AM NOT SURE IF IT WILL WORK:
have the loader put the data into Character[ ] and keep track of how many
characters have been loaded
wait for players to join... and wait for game to begin initialization
create 2d array Player[A,B] with 'A' being the number of characters loaded
and 'B' being the number of players in the game
create a bunch of pointers to the data in Character[ ] for each Player[ , ] index
THE PROBLEM I SEE WITH THAT:
I will almost always end up with a bunch of empty Player classes
This would be alot easier to do if i knew how many different characters there were going to be... but sadly there is no way of me knowing...
Can anyone Think of a more efficient way to do this???