ambiguous error ?!

Hello guys
I have three classes. First is called Tiles, second is Map, Third is MiniMap.
Now Map is inheriting from Tiles and MiniMap is inheriting from Map and Tiles.

now my problem is when MiniMap tries to inherit from Map and Tiles at the same time and i try to use Tiles functions and variables i get this error that says "Variable name from Tiles is ambiguous".

Now MiniMap is successfully inheriting from Map but the problem is I can't inherit from Tiles and Map at the same time.

1
2
3
4
5
6
7
8
9
10
11
12
class Tiles
{
protected:
	Tiles();
	~Tiles();
	void LoadTiles();

	static short const GrassID = 1, StoneID = 2;
	static short const TileX = 32, TileY = 32;
	sf::Image GrassImage, StoneImage;
	sf::Sprite GrassSprite, StoneSprite;
};



1
2
3
4
5
6
7
8
9
10
11
12
13
class Map : Tiles
{
public:
	Map();
	~Map();
	void Load();
	void Draw(sf::RenderWindow &Window);

protected:
	static const short MapX = 25, MapY = 19; // MapX = ScreenX(800) / TileX(32) .... MapY = ScreenY(600) / TileY(32)
	static const short MapOffsetY = 32;
	short map[MapX][MapY];
};


1
2
3
4
5
6
7
8
9
10
11
12
class MiniMap : Tiles, Map
{
public:
	MiniMap();
	~MiniMap();
	void Init();
	void Draw(sf::RenderWindow &Window);

private:
	sf::Image Image;
	sf::Sprite Sprite;
};


I get the error whenever i try to use any variable or function from Tiles class.
Why would Minimap inherit from Tiles ánd Map, if Map already inherits from Tiles? I'm guessing the ambiguity occurs because the compiler doesn't know if you mean Minimap->Map->Tiles->TileX or Minimap->Tiles->TileX.
@ Gaminic

well I tried just to inherit from Map but it gave me the same error and then I tried to inherit from both Map and Tiles and still it gave me the same error.

ok How can i use all the variable of Map and Tiles in MiniMap?
dump.
Topic archived. No new replies allowed.