I'm having a hard time trying to truly grasp vectors, list, and maps I have plenty of books, and online links for referencing, and I know what they do. I'm just having a hard time implementing it in my game.
I have an Entity class
that has a vector and a vector iterator
//Our Entity List
static vector<Entity*> EntityList;
static vector<Entity*>::iterator EntityList_Interator;
Then I have as an object
//Global vars for our game!
static const int num_rows = 6;
static const int num_cols = 5;
static const int num_blkz = num_rows * num_cols;
//awards scene
static const int num_awardz = 5;
static const string awardz_directory[5] = {"images/5000_blur.png","images/10000_blur.png","images/blue_level_blur.png",
"images/second_waive_blur.png","images/complete_blur.png"};
static const int awdz_blk_size = 25;
//Entities
Entity Blockz[num_blkz];
Entity Awardz[5];
I have it created this way because when I change it to map or list or whatever I choose to decide to change it to I'll be able to create multiple objects of different multiple objects and add them to a single sprite_list that will let me know what is on, off of the screen what to push and pop in the list to render, etc...
SO for the most part I think I'm designing it correctly.
However I don't know how to delete the i'th object in the list using the iterator or without using it in the Blockz
.EntityList
Can someone please help?