586
General / [Solved] Resource Manager
« on: January 03, 2011, 04:27:11 am »
SearchFileName is just a parameter that you would pass through the search function! Check now!
Notice this:
vector< pair<string, sf::Image*> > ImageList;
So, ImageList is a vector, a dynamic array which contains in each position a pair<string, sf::Image*>.
ImageList with 2 images loaded:
ImageList[0] is a pair<string, sf::Image*>
ImageList[1] is also a pair<string, sf::Image*>
When you reference the ImageList, being i a valid position, it counts as the pair, and you can check the pair values, using first and second, that will return objects you stored. Check STL and C++ documentation for a better information : )
http://www.cplusplus.com/reference/stl/vector/
http://www.cplusplus.com/reference/std/utility/pair/
Notice this:
vector< pair<string, sf::Image*> > ImageList;
So, ImageList is a vector, a dynamic array which contains in each position a pair<string, sf::Image*>.
ImageList with 2 images loaded:
ImageList[0] is a pair<string, sf::Image*>
ImageList[1] is also a pair<string, sf::Image*>
When you reference the ImageList, being i a valid position, it counts as the pair, and you can check the pair values, using first and second, that will return objects you stored. Check STL and C++ documentation for a better information : )
http://www.cplusplus.com/reference/stl/vector/
http://www.cplusplus.com/reference/std/utility/pair/