
#ifndef PLAYSTATE_H
#define PLAYSTATE_H


#include "SDL.h"
#include "gamestate.h"
#include "sprite.h"
#include "player.h"
#include "bulletmanager.h"
#include "bulletmanufacturer.h"
#include "factory.h"
#include "imagemanager.h"
#include "enemymanufacturer.h"
#include "enemymanager.h"
#include "explosionmanufacturer.h"
#include "explosionmanager.h"



enum {KEY_UP = 0, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_SPACE};
class CPlayState : public CGameState
{
public:
	void Init();
	void Cleanup();

	void Pause();
	void Resume();

	void HandleEvents(CGameEngine* game);
	void Update(CGameEngine* game);
	void Draw(CGameEngine* game);

	static CPlayState* Instance() {
		return &m_PlayState;
	}

protected:
	CPlayState() { }

private:
	static CPlayState m_PlayState;

	CBulletManager BulletManager;
	CEnemyManager EnemyManager;
	CExplosionManager ExplosionManager;

    CFactory m_Factory;
    CImageManager m_ImageManager;



	//Uint32 lastexplosion;

	int firerate;

    bool KeyState[5];
	CPlayer m_Player;


	SDL_Surface* explosion;
};

#endif
