Tetris/playstate.hpp
2014-11-07 20:47:50 +01:00

69 lines
1.0 KiB
C++

# ifndef PLAY_STATE_HPP_INCLUDED
# define PLAY_STATE_HPP_INCLUDED
# include <SDL/SDL.h>
# include <iostream>
# include <string>
# include <fstream>
# include "game.hpp"
# include "gamestate.hpp"
# include "resource.hpp"
# include "part.hpp"
# include "map.hpp"
# include "stringinput.hpp"
class PlayState : public GameState
{
public:
void Init();
void Clean();
void Pause();
void Resume();
void HandleEvents ( game * Game );
void Update ( game * Game );
void Draw ( game * Game );
// Implement Singleton Pattern
static PlayState * Instance()
{
return &m_PlayState;
}
friend void PlayInfo ( PlayState * Info, game * Game );
protected:
PlayState() {}
private:
void Save(string Name, int Lines);
static PlayState m_PlayState;
map Map;
part Part;
part Next;
int score;
int level;
int lines;
int tick;
bool nameEntered;
bool nameEntering;
SDL_Surface * message;
SDL_Color textColor;
StringInput name;
};
void PlayInfo ( PlayState * Info, game * Game );
# endif