OK I've implemented it in arrays, just as an example to clarify a bit.
First a simple definition..
Later in the code, when the player hits the fire button it spawns two lazers, and the assigns which player owns the models to the array. I've put in some dummy values for simplicity.
dbLoadObject("lazer.x",20);
playerArray[20] = playerID;
dbLoadObject("lazer.x",21);
playerArray[21] = playerID;
This is why in my case playerID = objectID wouldn't work. There's already 3 objects associated with the same playerID, and I'm pretty much guaranteed to have more than this when all is said and done.
Then in my collision code I've done the following, which gives me the playerID linked with the lazer. With further development I can make it link the other modelID (rightLazerImpact) to it's player ID as well and then credit the sources and receivers of the impact properly.
int rightLazerImpact = dbObjectCollision(21,0);
if(rightLazerImpact)
{
dbDeleteObject(21);
sprintf(debugOut,"Player %d hit model %d with lazer
21",playerArray[21],rightLazerImpact);
}
I've been looking into vectors, but I can't seem to find a good tutorial or documentation on how to insert into the middle of a vector. (like in the example above, inserting directly into the 21st position) Getting the objects at a certain position with a vector seems easy enough though using the vector.at() function.
Also I would rather have an array of custom classes instead of integers, but this was just a quick example.
So I guess my final question is.. "What C++ data structure should I use to accomplish the above functionality, but have it also be resizeable?" Are vectors the answer or should I be looking elsewhere? I like the array because it's indexable, but having a finite size makes me afraid I'll overflow it eventually.
I'm going to cut this off now because it's getting way too long, thanks for all of the insight so far guys.