#pragma once

#include "app.h"

extern HWND ghWnd;

class ApplicationManager : public Node
{
public:
	ApplicationManager(HINSTANCE hInstance, HWND hWnd, Scalar frame_rate);
	~ApplicationManager();

	void StartApplication(Application *new_app);

	void RunMissions();

	Scalar GetFrameRate()
	{
		Check(this);
		return frameRate;
	}

	HINSTANCE	GetHInstance()	{ return mHInstance; }
	HWND		GetHWnd()		{ return ghWnd; }

	static ApplicationManager* GetCurrentManager()	{ return CurrentAppManager; }

protected:
	static ApplicationManager* CurrentAppManager;

	Scalar					frameDuration, frameRate;
	SChainOf<Application*>	runningApplications;
	HINSTANCE				mHInstance;
};
