Guest User

Untitled

a guest
Dec 11th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. std::vector<std::vector<int>>
  2.  
  3. for (std::vector<std::vector<Tile>>::const_iterator layerRow = ...) {}
  4.  
  5. class Map
  6. {
  7. public:
  8. using tileLayerVector_t = std::vector<std::vector<Tile>>;
  9. using rawDataLayerVector_t = std::vector<std::vector<int>>;
  10. tileLayerVector_t getTileLayer(const std::string pLayerName) const;
  11. void generateTileMapLayer(const std::string pMapLayerName, const rawDataLayerVector_t pRawMapData, const std::shared_ptr<Texture> pTexture);
  12. }
  13.  
  14. #include <map.h>
  15.  
  16. tileLayerVector_t Map::getTileLayer(const std::string pLayerName) const
  17. {
  18. return mapLayers.at(pLayerName);
  19. }
  20.  
  21.  
  22. void Map::generateTileMapLayer(const std::string pMapLayerName, const
  23. rawDataLayerVector_t pRawMapData, const std::shared_ptr<Texture> pTexture)
  24. {
  25. int tileCount = 0;
  26. int xPos = 0;
  27. int yPos = 0;
  28.  
  29. ...
  30.  
  31. std::pair<std::string, tileLayerVector_t> tileLayer(pMapLayerName, tileMapLayer);
  32. mapLayers.insert(tileLayer);
  33. }
Add Comment
Please, Sign In to add comment