KPlayerMenuState.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //---------------------------------------------------------------------------
  2. // Sword3 Engine (c) 2002 by Kingsoft
  3. //
  4. // File: KPlayerMenuState.h
  5. // Date: 2002.12.10
  6. // Code: 边城浪子
  7. // Desc: PlayerMenuState Class
  8. //---------------------------------------------------------------------------
  9. #ifndef KPLAYERMENUSTATE_H
  10. #define KPLAYERMENUSTATE_H
  11. #include "GameDataDef.h"
  12. enum
  13. {
  14. PLAYER_MENU_STATE_NORMAL = 0,
  15. PLAYER_MENU_STATE_TEAMOPEN,
  16. PLAYER_MENU_STATE_TRADEOPEN,
  17. PLAYER_MENU_STATE_TRADING,
  18. PLAYER_MENU_STATE_IDLE,
  19. PLAYER_MENU_STATE_NUM,
  20. };
  21. class KPlayerMenuState
  22. {
  23. public:
  24. int m_nState;
  25. int m_nTradeDest; // 服务器端记的是 player index 客户端记的是 npc id
  26. int m_nTradeState; // 是否已经点了ok 0 没有 1 点了
  27. char m_szSentence[MAX_SENTENCE_LENGTH];
  28. #ifdef _SERVER
  29. int m_nBackState;
  30. char m_szBackSentence[MAX_SENTENCE_LENGTH];
  31. #endif
  32. #ifndef _SERVER
  33. int m_nTradeDestState;
  34. #endif
  35. public:
  36. KPlayerMenuState();
  37. #ifdef _SERVER
  38. void Release();
  39. void BackupState();
  40. void RestoreState();
  41. void SetState(int nPlayerIdx, int nState, char *lpszSentence = NULL, int nSentenceLength = 0, DWORD dwDestNpcID = 0);
  42. void RestoreBackupState(int nPlayerIdx);
  43. #endif
  44. #ifndef _SERVER
  45. void Release();
  46. void SetState(int nState);
  47. #endif
  48. };
  49. class KPlayerMenuStateGraph
  50. {
  51. public:
  52. char m_szName[PLAYER_MENU_STATE_NUM][80];
  53. public:
  54. BOOL Init();
  55. void GetStateSpr(int nState, char *lpszGetName);
  56. };
  57. #endif