#ifndef cgame_h
#define cgame_h

#include "ForwardDeclarations.h"
#include "OGLPlatformSpecific.h"
#include "cGrid.h"
#include "cTimer.h"
//declarations for sound
#include "cGameMode.h"
#include <iostream>
#include <String>
#include <queue>
using namespace std;

class cGame
{   
public:
    static cGame* instance();
    
    // since we use the game as a global variable and objects 
    // are constructed that require opengl already to be initialized,
    // delay allocating them intil later.
    void init(); 
    
    void display(void);
    void idle();
    void keyboard(unsigned char key, int x, int y);
	void keyboardUp(unsigned char key, int x, int y);
    void specialKey(int key, int x, int y);
    void specialKeyUp(int key, int x, int y);
    void mouseClick(int button, int state, int x, int y); 
    void mouseMove(int x, int y);
    
    int screenWidth_, screenHeight_; // updated by reshape in main
    
    float t_; 	
    
    bool upKeyPressed_, downKeyPressed_, leftKeyPressed_, rightKeyPressed_;
	bool jKeyPressed_, kKeyPressed_, lKeyPressed_;
	bool key4Pressed_, key5Pressed_, key6Pressed_;
private:
    
    
    //GAME_MODE mode_;
    
    cGame(); // do nothing
    
    void startGame();							// setup everything at the beginning of the game
    void dropBlocks();							// respond to input and automatically fall in block dropping mode
    
    void update();				// gets time difference between last update call. causes blocks to move down with time

    cGrid grid_;
	cGrid grid2_;
 
    cTimer timer_;					// total time running in round

	bool paused_;                    // if true, the game is paused

	bool started_;					// if false, game is in player # select screen, otherwise, game in progress
	int numPlayers_;

    // singleton instance
    static cGame* instance_; 
};

#endif // end define cgame_h
