#ifndef __SCENEMANAGER_H__
#define __SCENEMANAGER_H__
#pragma once
#include <vector>
#include <string>
#include <log4cplus/logger.h>
#include <log4cplus/configurator.h>
using namespace log4cplus;
using namespace std;
//Forward declaration, to avoid having to include "UIScene.h".
class UIScene;
class SceneManager
{
private:
vector<UIScene> m_Scenes;
public:
void LoadInitialScreen(string Path);
void AddScreen(UIScene Screen);
};
#endif
#ifndef __UISCENE_H__
#define __UISCENE_H__
#pragma once
#include <vector>
#include <string>
#include "UIBackground.h"
#include "SceneManager.h"
#include "libfar.h"
using namespace std;
class UIScene
{
private:
string m_ArchivePath;
SceneManager m_SceneMgr;
vector<UIBackground> m_Backgrounds;
public:
UIScene(SceneManager SceneMgr, string ArchivePath);
void LoadBackground(int ID);
};
#endif
SceneManager.h compiles perfectly, and I didn't really have a problem until I added the method AddScreen(UIScene Screen) to ScreenManager.
void SceneManager::AddScreen(UIScene Screen)
{
m_Scenes.push_back(Screen);
}
This code (in SceneManager.cpp) gives me the following error:
Error 1 error C2027: use of undefined type 'UIScene
Even though UIScene has been forwardly declared in 'SceneManager.h'!
What gives?