I was wondering, what is the best way to keep track of objects.
I want all GameObject to have access to a list of all the other GameObject on the game play layer.
Should I loop throuh all of the CCNodes on that layer and typecast to GameObject to see if the object is a GameObject, or is it slow to typecast stuff.
The other option would be that all GameObject, put a reference to themselves in a list, and that all GameObject have access to that list. The objects would then remove themselves for the list when removed from the scene. Only problem is, I don’t know what to use for this list.
in C# I would have used a List<> class. In c++, there is vector, but it is slow to remove stuff from the middle of the list. An array needs to be declared a fixed size and not so easy to remove stuff from middle.
Any Ideas for the most performing thing to do?