Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you for answering. I've implement map, but I don't feel like I've done it right, since I rarely use the key, I most of the time iterate over categories and use its .first as its name. <- That made me remove getName() fucntion form class Category. I don't know how smart pointers work, but I will look it up, just one question, how would the pointer that "pointers to them in category" works? Is it some kind of iterator?. Thank you.
Thanks for answering!. Well, I got a problem, and it's that since goalNode's parent has never been set to anything I get access violation reading location in parent->parent->position
Oh, ok! Also, if you did run my code you can see that when the y axis = 20 it can't run. Thats because in my map class im using only one vector instead of a vector of vectors / 2d array, and when I'm indexing my map what I do is (as you can see in map.cpp) y *= size, so depending on y you'll get to the row you desire. The problem is that y's value can be size, and since map's vector's size = size^2 when I do y*= size im doing size *= size so it will run out of bounds. I don't know if you understand what I'm trying to say but if you glance at my code and run it you'll understand.Thanks
I'm not only removing the back element, as you can see in solver::aStar() inside the while loop im doing this: openList.remove(current) and current can be anywhere not only on the back.
Thanks for answering! Sorry for the late response, I have been in a trip. Do you know of something that I could use instead of a std::list in the openList and closedList to make my algorithm quicker? Oh, and also, how do I calculate my algorithm's 'speed'?