RUPlatform-mac.mm 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Platform-ios.cpp
  3. //
  4. // Created by 杜家兑macbook on 17/2/11.
  5. //
  6. #include "RUPlatform.h"
  7. USING_NS_CC;
  8. NS_RU_BEGIN
  9. static Platform *g_Platform = nullptr;
  10. Platform* Platform::getInstance()
  11. {
  12. if (g_Platform == nullptr)
  13. {
  14. g_Platform = new (std::nothrow) Platform;
  15. }
  16. return g_Platform;
  17. }
  18. void Platform::reportLog(string log){
  19. }
  20. void Platform::vibrate(int duration, int strength) {
  21. }
  22. bool Platform::saveToSharedPreferences(const std::string& key, const std::string& base64Data) {
  23. return true;
  24. }
  25. std::string Platform::readFromSharedPreferences(const std::string& key) {
  26. return "";
  27. }
  28. double Platform::getSystemUpTime(){
  29. //返回用户开机了多少秒
  30. double second = [[NSProcessInfo processInfo] systemUptime];
  31. return second;
  32. }
  33. int Platform::getServerTime() {
  34. return time(nullptr);
  35. }
  36. /// 显示调试对话框
  37. void Platform::showDbgView() {
  38. }
  39. NS_RU_END