Game.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #ifndef _Game_H_
  2. #define _Game_H_
  3. #include "pub.h"
  4. #include "PublicSDKMotion.h"
  5. #include "RunGame.h"
  6. #include "DanceGame.h"
  7. #include "Tricycle.h"
  8. #include "H5_Game.h"
  9. #include "Interaction.h"
  10. #include "FootStep.h"
  11. #include "FingerGuessing.h"
  12. #include "Aerobics.h"
  13. #include "Kongfu.h"
  14. #include "SportFunction.h"
  15. #include "BuildHouse.h"
  16. #include "CutCake.h"
  17. #include "JumpHouse.h"
  18. #include "StepVel.h"
  19. #include "TestGame.h"
  20. #include <fstream>
  21. #include <time.h>
  22. #include <sstream>
  23. #if defined(_WIN32)
  24. #if defined( SDK_EXPORTS)
  25. #define SDK_EXPORT __declspec(dllexport)
  26. #else
  27. #define SDK_EXPORT __declspec(dllimport)
  28. #endif
  29. #else
  30. #define SDK_EXPORT
  31. #endif
  32. class SDK_EXPORT Game
  33. {
  34. public:
  35. Game(int gametype);
  36. void GameProcess(int gameTime, int* right_pos_data, int* right_att_data, int* right_acc_data, int right_zupt, int right_front_mag, int right_back_mag,
  37. int* left_pos_data, int* left_att_data, int* left_acc_data, int left_zupt, int left_front_mag, int left_back_mag,
  38. int jump, int down, int rssi);
  39. void GameProcessBuf(uint8_t* buf, int len);
  40. void getGameResult(int* matrix);
  41. void getFootAtt(int* left_att, int* right_att);
  42. string getGameDataStr();
  43. int getStepStatus(int left_or_right);
  44. int getStepFreq(int left_or_right);
  45. int getStepCount(int left_or_right);
  46. float getGamePos(int left_or_right, int index);
  47. string getVersion();
  48. int getInteractionCMD();
  49. int getGameStepVel();
  50. void setGameDataStr();
  51. int getMotionCount(int motion_type);
  52. bool setShoesDataBuff(int &gameTime, int* right_pos_data, int* right_att_data, int* right_acc_data, int &right_zupt, int& right_front_mag, int& right_back_mag,
  53. int* left_pos_data, int* left_att_data, int* left_acc_data, int& left_zupt, int& left_front_mag, int& left_back_mag,
  54. int& jump, int& down, int& rssi);
  55. private:
  56. int GameType;
  57. int leftStepRate;
  58. int rightStepRate;
  59. int leftRate;
  60. int rightRate;
  61. int resultMatrix[RESULT_LEN];
  62. float leftRotate[4];
  63. float rightRotate[4];
  64. fstream foot_data_file;
  65. int InteractionCMD;
  66. int right_pos_data[3];
  67. int right_att_data[3];
  68. int left_pos_data[3];
  69. int left_att_data[3];
  70. int left_acc_data[3];
  71. int right_acc_data[3];
  72. int left_gyr_data[3];
  73. int right_gyr_data[3];
  74. int girl_shoes;
  75. int s_zupt;
  76. int h_zupt;
  77. int down;
  78. int jump;
  79. int rssi;
  80. int posTimeStamp;
  81. int attTimeStamp;
  82. uint32_t gameTime = 0;
  83. int lastTimeStamp = -1;
  84. uint16_t right_front_mag;
  85. uint16_t right_back_mag;
  86. uint16_t left_front_mag;
  87. uint16_t left_back_mag;
  88. string data_str;
  89. int shoes_down;
  90. PublicSDKMotion *game;
  91. FootStep leftFootStep;
  92. FootStep rightFootStep;
  93. StepVel stepVel;
  94. Interaction interaction;
  95. int shoes_data_buff_size;
  96. int setShoesDataBuff_count;
  97. };
  98. #endif