Abstract classes and iterators
I am making a game entity class for a 2d allegro game of mine.
The abstract class will be entity .. the subclasses will be player, map_blocks and items
The main reason I am using it is to have an iterator to draw all objects wether it be player .. item or map_block (as in the blocks the player can collide into)
I am a little unsure about the implementation
Code:
virtual void draw(BITMAP *bmp)=0; // this is the abstract function in the entity class
Code:
void draw(BITMAP *bmp); // overriding function in player class..draw the player
How do I setup the iterator, or should i say for loop though?