bonjour,

voilà j'arrive pas à utiliser un iterateur comme je le voudrai ... je pige pas vraiment ce qu'il ne faut pas fair... une idée ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int expand(std::list<waymap_way> &pascher){
			if (expanded){ // expand childs < cout
				return 0; // ne peu plus etre expand
			}
			expanded=true;waymap_way*  tmp;
			list <waymap_way>::iterator ite = pascher.begin();
 
			for(unsigned int i = 0; i < nod->voisins.size(); i++){
				childs.push_back(tmp = new waymap_way(nod->voisins[i], this));
				tmp->cost = ((parent == 0)? 0:cost)+(nod->voisins[i]->pos - nod->pos).length();
				if(!pascher.empty()){
					while (ite != pascher.end() && (*ite).cost <= tmp->cost){ 
						ite++;
						MinimalOgreApp::mConsole->print("++");
					}
					while (ite != pascher.begin() && (*ite).cost > tmp->cost){// plantage là...
						MinimalOgreApp::mConsole->print("--");
						ite--;
					}
				}
				MinimalOgreApp::mConsole->print(toStr(i)+" !! :"+toStr(tmp->cost));
				//
				if (ite == pascher.end()||pascher.empty()) pascher.push_back(*tmp);
				else pascher.insert(++ite, *tmp);//*/
			}
		}
any help?