//Iterate over every pixel in the dataImage and set the corresponding Data ID's
//These ID's will be used to initialize the corresponding tiles
void World::GetWorldData(SDL_Surface* surface)
{
	for ( int y = 0; y < m_Height ; ++y)
	{
		for (int x = 0; x < m_Width; ++x)
		{
			uint8_t r;
			uint8_t g;
			uint8_t b;
			SDL_LockSurface(surface);
			SDL_GetRGB(getPixel(surface, x, y), surface->format, &r, &g, &b);
			SDL_UnlockSurface(surface);
			
			if ((r == 76) && (g == 108) && (b == 28))
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightgrass);
			}
			else if(r==100 && g==64 && b==40)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightdirt);
			}
			else if (r == 0 && g == 40 && b == 112)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightwater);
			}
			else if (r == 44 && g == 92 && b == 16)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::darkgrass);
			}
			else if (r == 90 && g == 112 && b == 56)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightgrasswrocks);
			}
			else if (r == 58 && g == 93 && b == 38)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::darkgrasswrocks);
			}
			else if (r == 64 && g == 44 && b == 0)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::darkdirt);
			}
			else if (r == 99 && g == 76 && b == 61)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightdirtwrocks);
			}
			else if (r == 61 && g == 51 && b == 28)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::darkdirtwrocks);
			}
			else if (r == 0 && g == 24 && b == 92)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::darkwater);
			}
			else if (r == 255 && g == 118 && b == 18)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::forest);
			}
			else if (r == 108 && g == 108 && b == 108)
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::mountain);
			}
			else
			{
				m_pWorldTiles[y][x] = std::make_shared(utils::TileType::lightgrass);
			}

		}
	}
}