#ifndef _H_MAP_H
#define _H_MAP_H

#include <vector>
#include <memory>

#include "graphics/instancedraw.h"

//class TileTextureInstance;
class Shader;
class Camera;
struct MapData;
//struct InstanceData;
struct Tile;

class Map
{
public:
	Map(const std::shared_ptr<MapData>& mapData, const std::shared_ptr<Shader>& shader);

	const std::vector<std::vector<int>> getCollisionMap() const { return collisionMap; }

	void render(const std::shared_ptr<Camera>& camera);

private:
	void loadMap();
	void createCollisionMap();

	const std::shared_ptr<MapData> mapData;

	std::shared_ptr<TileTextureInstance> instanceHandle;
	std::shared_ptr<Shader> shader;
	std::vector<std::vector<std::shared_ptr<Tile>>> tileIds;
	std::vector<std::vector<int>> collisionMap;
	std::vector<InstanceData> tileData;
};

#endif