📄 maingame.h
字号:
// MainGame.h: interface for the MainGame class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINGAME_H__FA517629_B1B3_41E3_97D2_F5DA150FB29D__INCLUDED_)
#define AFX_MAINGAME_H__FA517629_B1B3_41E3_97D2_F5DA150FB29D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class Game_Unit;
enum ENUM_MODE{
ENUM_LOBBY=0,
ENUM_GAME=1,
};
#define NUM_TABLE_IN_LINE 3
//#define NUM_TABLE_MAX 60
class MainGame : public CGsGame , public Game_Client, public STRUCT_TABLE_INFO
{
public:
HRESULT Redraw_Msg();
void add_game_msg(D3DCOLOR color, const char* str_msg,...);
void EndGame();
BOOL StartGame();
BOOL InitGame();
BOOL LoadConfig();
MainGame(CGsEngine* pEngine);
virtual ~MainGame();
virtual HRESULT Draw(CGsSurface* pSurface);
virtual VOID Cleanup();
virtual HRESULT Render();
virtual FLAG Update(DWORD dwPassTime);
virtual LRESULT MsgProc( UINT uMsg, WPARAM wParam, LPARAM lParam );
virtual ID OnMouseMove( UINT nFlags, GPOINT point );
virtual ID OnMouseWheel( UINT nFlags, short zDelta, GPOINT point );
virtual ID OnLButtonDown( UINT nFlags, GPOINT point );
virtual ID OnLButtonUp( UINT nFlags, GPOINT point );
virtual ID OnLButtonDbClk( UINT nFlags, GPOINT point ) ;
virtual ID OnRButtonDown( UINT nFlags, GPOINT point );
virtual ID OnRButtonUp( UINT nFlags, GPOINT point );
virtual ID OnRButtonDbClk( UINT nFlags, GPOINT point );
virtual ID OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
virtual ID OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
virtual ID OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
virtual VOID ReleaseSource(); //{return S_OK;}
virtual HRESULT RestoreSource(); //{return S_OK;}
protected:
FLAG Update_lobby();
FLAG Update_game();
HRESULT Render_lobby();
HRESULT Render_game();
virtual VOID OnUICmd(CGsUIPanel* pUI, UINT msg, LONG param);
virtual void on_speek(uint32 uid_speeker, const char *strUser, const char* strSpeek);
virtual void on_handle_place(void* pData);
virtual void on_login(void* pData);
virtual void on_add_unit(void* pData);
virtual void on_del_unit(void* pData);
virtual void on_handle_unit(void* pData);
public:
void update_ui_game();
void SetMode(ENUM_MODE mode);
ENUM_MODE GetMode();
BOOL update_game_clock(ULONG game_time);
void update_ui();
STRUCT_ADD_USER* GetUser(ULONG idUser);
void add_skill_effect(GPOINT pt_src, GPOINT pt_dest, LPCSTR str_effect, LPCSTR str_particles = NULL);
void query_handle_player(ULONG id_player);
int GetPlayerIndex(ULONG id_user);
CPlayer* GetPlayer(ULONG id_user = 0);
GSANI m_ani_dreamland;
GSANI m_ani_test;
GSANI m_ani_bubble;
CGsMedia m_bk_music;
GRECT m_rc_energy;
GRECT m_rc_power;
DWORD m_game_start_time;
protected:
void update_ui_lobby();
HRESULT Draw_lobby(CGsSurface *pSurface);
HRESULT Draw_game(CGsSurface *pSurface);
virtual void process_packet(NET_Packet* ptr_packet);
virtual void on_msg_score(STRUCT_SCORE* pSS);
virtual void on_msg_ui_cmd(ULONG id_user, USHORT ui_cmd);
virtual void on_msg_scene_data(ULONG id_user, STRUCT_ADD_USER* ptr_add_user, STRUCT_ADD_SCENE* ptr_add_scene, UCHAR* ptr_scene_data);
virtual void on_msg_add_user(STRUCT_ADD_USER* pData);
virtual void on_msg_add_table(STRUCT_TABLE_INFO* ptr_table_info);
virtual void on_msg_shoot(ULONG uid, STRUCT_SHOOT_DATA* ptr_shoot);
CGsTexture m_tex_game_msg;
CGsTexture m_tex_game_time;
BOOL m_is_msg_change;
BOOL m_is_inputing_text;
BOOL m_is_handling_place;
BOOL m_is_playing;
D3DTLVERTEX m_aVertex[4];
BOOL m_is_show_magic_book;
GRECT m_rc_magic_book;
struct GAME_MSG
{
std::string str_msg;
D3DCOLOR color;
DWORD tick_speek;
};
std::list<GAME_MSG> m_list_game_msg;
CPlayer* m_ptr_player;
CPlayer m_array_player[NUM_CHAIR];
int m_index[NUM_CHAIR];
std::map<std::string, DWORD> m_msg_holder;
std::map<ULONG, STRUCT_ADD_USER> m_map_user;
std::map<USHORT, STRUCT_TABLE_INFO> m_map_table;
int m_page_table_select;
int m_index_table_select;
BOOL m_is_show_lobby;
int m_page_player_select;
int m_index_player_select;
ULONG m_id_player_talk;
BOOL m_is_broadcast;
struct _EFFECT_SKILL {
GSANI ani;
//int idx_src;
//int idx_obj;
GPOINT pt_dest;
GPOINT pt_src;
DWORD start_time;
CGsParticleEmitter* ptr_effect;
};
std::list<_EFFECT_SKILL*> m_lst_effect_skill;
};
#endif // !defined(AFX_MAINGAME_H__FA517629_B1B3_41E3_97D2_F5DA150FB29D__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -