Game.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #pragma once
  2. #ifndef _Game_H_
  3. #define _Game_H_
  4. #include "pub.h"
  5. #include "RunGame.h"
  6. #include "InertialTrajProcess.h"
  7. #include "DanceGame.h"
  8. #include "FootStep.h"
  9. #include "Interaction.h"
  10. #include "MonsterH5.h"
  11. #include "OriginTraj.h"
  12. #include "RuinsExplore.h"
  13. #include "Tricycle.h"
  14. #include "BigFoot.h"
  15. #include "publicMotion.h"
  16. #include "testGame.h"
  17. #include "H5.h"
  18. #include <fstream>
  19. #include <time.h>
  20. #include <sstream>
  21. class Game
  22. {
  23. public:
  24. Game(int gametype);
  25. void GameProcess(int timeStamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
  26. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
  27. int jump, int down, int rssi, int girl_shoes);
  28. void GameProcessBuf(uint8_t* buf, int len);
  29. void RunGameProcess(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
  30. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
  31. int jump, int down, int girl_shoes);
  32. void getGameResult(int* matrix);
  33. void getFootAtt(int* left_att, int* right_att);
  34. string getGameDataStr();
  35. int getStepStatus(int left_or_right);
  36. int getStepFreq(int left_or_right);
  37. int getStepCount(int left_or_right);
  38. float getGamePos(int left_or_right, int index);
  39. string getVersion();
  40. void start(string path_root);
  41. void end();
  42. void isBingo();
  43. int getInteractionCMD();
  44. void processCalorieData(int down, int jump);
  45. int getGameDownCount();
  46. int getGameJumpCount();
  47. int onlineDownEstimate();
  48. void setGameDataStr();
  49. private:
  50. int GameType;
  51. RunGame rungame;
  52. DanceGame dancegame;
  53. InertialTrajProcess rotateTrajLeft;
  54. InertialTrajProcess rotateTrajRight;
  55. MonsterH5 monsterH5;
  56. Interaction interaction;
  57. FootStep leftFootStep;
  58. FootStep rightFootStep;
  59. OriginTraj originTraj;
  60. RuinsExplore ruinsExplore;
  61. Tricycle tricycle;
  62. BigFoot bigfoot;
  63. publicMotion publicmotion;
  64. testGame testgame;
  65. H5 h5;
  66. int leftStepRate;
  67. int rightStepRate;
  68. int leftRate;
  69. int rightRate;
  70. int resultMatrix[4];
  71. float rotateMatrix[4];
  72. float leftRotate[4];
  73. float rightRotate[4];
  74. fstream foot_data_file;
  75. int bingo = 0;
  76. int InteractionCMD;
  77. int right_pos_data[3];
  78. int right_att_data[3];
  79. int left_pos_data[3];
  80. int left_att_data[3];
  81. int left_acc_data[3];
  82. int right_acc_data[3];
  83. int girl_shoes;
  84. int s_zupt;
  85. int h_zupt;
  86. int down;
  87. int jump;
  88. int rssi;
  89. int posTimeStamp;
  90. int attTimeStamp;
  91. uint32_t gameTime = 0;
  92. int lastTimeStamp = -1;
  93. uint16_t right_front_mag;
  94. uint16_t right_back_mag;
  95. uint16_t left_front_mag;
  96. uint16_t left_back_mag;
  97. uint32_t right_step;
  98. uint32_t left_step;
  99. int down_count;
  100. int jump_count;
  101. int last_down;
  102. int last_jump;
  103. int down_wait;
  104. int avoid_down_between_jump;
  105. uint32_t last_left_step;
  106. uint32_t last_right_step;
  107. string data_str;
  108. int shoes_down;
  109. };
  110. #endif