RUPlatform.h 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Platform.h
  3. //
  4. // Created by 杜家兑macbook on 16/9/18.
  5. //
  6. #ifndef RUPlatform_h
  7. #define RUPlatform_h
  8. #include <stdio.h>
  9. #include "cocos2d.h"
  10. #include "RUDefine.h"
  11. NS_RU_BEGIN
  12. class Platform {
  13. public:
  14. static Platform* getInstance();
  15. /*
  16. * 服务器上传日志(bugly)
  17. */
  18. void reportLog(string log);
  19. /*
  20. * 振动
  21. */
  22. void vibrate(int duration, int strength);
  23. bool saveToSharedPreferences(const std::string& key, const std::string& base64Data);
  24. std::string readFromSharedPreferences(const std::string& key);
  25. /// 获取系统启动之后多长时间(单位:秒)
  26. double getSystemUpTime();
  27. /// 获取服务器时间(单位:unix时间 秒)
  28. int getServerTime();
  29. /// 显示调试对话框
  30. void showDbgView();
  31. private:
  32. Platform() = default;
  33. ~Platform() = default;
  34. };
  35. NS_RU_END
  36. #endif /* defined(RUPlatform_h) */