Relative Content

Tag Archive for array

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it’s something I haven’t done before and I’ve been unable to find any material discussing the best way to approach it.

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it’s something I haven’t done before and I’ve been unable to find any material discussing the best way to approach it.

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it’s something I haven’t done before and I’ve been unable to find any material discussing the best way to approach it.

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it’s something I haven’t done before and I’ve been unable to find any material discussing the best way to approach it.

A vector of pointers to different derived classes of the same base class

I am writing a game in C++ which has different enemy types. I have defined a base Enemy class and I also have derived classes enemy1, enemy2 etc.
Now for updating these enemies in each iteration of the game, I want to have an array: EnemyArray with its elements pointing to the existing enemies so that I can make sure to update them all with their own version of update(), etc.