/*
 * AppStateBase.h
 *
 *  Created on: 2009-07-06
 *      Author: wasyl
 */

#ifndef APPSTATEBASE_H_
#define APPSTATEBASE_H_

#include <allegro5/allegro.h>

class AppStateBase
{
protected:
	static AppStateBase *sCurrent;

public:
	void run(AppStateBase *parent);
	AppStateBase *parent();

	virtual void handleEvents() = 0;
	virtual void update(double dt) = 0;
	virtual void render(ALLEGRO_DISPLAY *display) = 0;
	virtual ALLEGRO_KEYBOARD_STATE *keyState() = 0;
	virtual ALLEGRO_MOUSE_STATE *mouseState() = 0;

	virtual ~AppStateBase(){};

	/**
	 * Returns the currently running state.
	 */
	static AppStateBase *current() { return sCurrent;}
};

#endif /* APPSTATEBASE_H_ */
