0 Members and 1 Guest are viewing this topic.
std::vector<enemy>::iterator It;enemy Enemy;for(It = List.begin(), int i = 0; i < List.size(); i++, It++){ Enemy = List.at(i); List.erase(It); //change things like position and stuff... List.push_back(It);}
for(std::vector<Ennemy>::iterator It = List.begin(); It != List.end(); ++It){ //change things like position and stuff... It->GetPosition(); It->SetLife(20);}
for(int i = 0; i < List.size(); i++){List[i].GetPosition();List[i].SetLife(20);}
Code: [Select]std::vector<enemy>::iterator It;enemy Enemy;for(It = List.begin(), int i = 0; i < List.size(); i++, It++){ Enemy = List.at(i); List.erase(It); //change things like position and stuff... List.push_back(It);}