[ create a new paste ] login | about

Link: http://codepad.org/Yjx4mu36    [ raw code | output | fork ]

C++, pasted on Jan 11:
class IScene;
namespace EDGE
{


	class Director
	{
	public:
		Director();
		void createNewScene(IScene* scene);
	};
}

namespace EDGE
{
	class IApp
	{
	public:
		IApp(const std::string theTitle = "Basic Application");
		virtual void initSceneFactory(void) = 0;

		Director* directorManager;

	private:
		bool aRunning;
	};
}

namespace EDGE
{
	class IScene
	{
	public:
		IScene(IApp& anApp);
	};
}


class GameApp : EDGE::IApp
{
public:
	GameApp(const std::string theTitle = "Sample Title");

private:
	virtual void initSceneFactory();
};


class GameScene : public EDGE::IScene
{
public:
	GameScene(EDGE::IApp& anApp);
};


namespace EDGE
{
	Director::Director()
	{
		// Do something
	}

	void Director::createNewScene(IScene* scene)
	{

	}
}

namespace EDGE
{
	IApp::IApp(const std::string theTitle) :
	directorManager()
	{
		directorManager = new Director();
	}
}


namespace EDGE
{
	IScene::IScene(IApp& anApp)
	{
		// Do something
	}
}


GameApp::GameApp(const std::string theTitle) : EDGE::IApp(theTitle)
{
	// Do init stuff
}

void GameApp::initSceneFactory()
{
	// Try to create a scene
	// This fails..
	directorManager->createNewScene(new GameScene(*this));
}

GameScene::GameScene(EDGE::IApp& anApp) : EDGE::IScene(anApp)
{
	// DO something
	// ..
}








int main(void)
{
return 0;
}


Output:
1
2
Line 63: error: prototype for 'void EDGE::Director::createNewScene(EDGE::IScene*)' does not match any in class 'EDGE::Director'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: