core.h 648 Bytes
Newer Older
Hurstel's avatar
Hurstel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#ifndef __CORE_H__
#define __CORE_H__




#include "state.h"

#include "messager.h"
#include "manager.h"

static const unsigned int CORE_ID= 1;

class Core : public StateReciever, public InAppMessager::Agent{
public:
	inline Core(int argc, char** argv)
	{
		m_startArgs.argc= argc;
		m_startArgs.argv= argv;

		StateManager::addReciever(this);
		InAppManager::addAgent(this);
	}

	void onStateChange(STATE current, STATE previous);


	void Start();

protected:
	void recieveMessage(const InAppMessage& iam);

	inline unsigned int getId() const{return CORE_ID;}

private:
	struct{
		int argc; char** argv;
	} m_startArgs;
};



#endif // __CORE_H__