www.pudn.com > ICE_1.4.zip > gs_main.h


// Class automatically generated by Dev-C++ New Class wizard 
 
#ifndef GS_MAIN_H 
#define GS_MAIN_H 
 
#include "Base_Classes/game_state.h" // inheriting class's header file 
 
//INCLUDES: 
 
//options 
#include "../Options/ICE_options.h" 
 
//data structs 
 
//graphics 
 
//ENUMS: 
 
//gs_Main Sub-States 
enum tGSM_Modes { 
	GSM_MODE_PLAY = 0,		//blocks falling, key input = on 
	GSM_MODE_PAUSED,		//movement stopped, key input = off 
	GSM_MODE_END,			//movement stopped, key input = off 
 
	GSM_MODES_NUM			//unused 
}; 
 
//gs_Main GUI objects ID enum 
enum tGSM_GUIobjs {   
    GSM_GUI_BTN_EXIT = 301, //quit application 
    GSM_GUI_BTN_PAUSED,     //quit application 
    GSM_GUI_BTN_END,        //quit application 
     
    GSM_GUI_OBJS_NUM        // unused  
}; 
 
//CLASS: 
 
// main game state, tetris blocks fall, points are scored, fun is had! 
class gs_Main : public game_State 
{ 
    irr::u32 m_boardTime;			//last time game board was updated 
    irr::u32 m_boardUpdateSpeed;	//interval between game board updates 
 
	irr::u32 m_inputTime;			//last time user input was checked 
	irr::u32 m_inputUpdateSpeed;	//interval between user input updates  
									//Range: (  m_bT <= m_iT < 2*m_bT  ) 
 
	tGSM_Modes m_mode;				//keep track of sub-states 
 
	bool keys[irr::KEY_KEY_CODES_COUNT] ;	//remember what keys user is pressing down 
     
    static irr::gui::IGUIButton *m_btn_exit; //button to quit back to gs_Intro 
    static irr::gui::IGUIButton *m_btn_paused; //button to quit back to gs_Intro 
    static irr::gui::IGUIButton *m_btn_end; //button to quit back to gs_Intro 
     
	public: 
		// class constructor 
		gs_Main(game_StateHandler*handler); 
		// class destructor 
		virtual ~gs_Main(); 
 
		virtual void Render(); 
		virtual bool onEvent(irr::SEvent event); 
		virtual void Update(); 
 
}; 
 
#endif // GS_MAIN_H