IAPUserData.hpp 815 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // IAPUserData.hpp
  3. // TileManor
  4. //
  5. // Created by 徐炼新 on 2024/9/30.
  6. //
  7. #ifndef IAPUserData_hpp
  8. #define IAPUserData_hpp
  9. #include <cocos2d.h>
  10. #include "IAPDefine.hpp"
  11. NS_IAP_BEGIN
  12. enum UserBuyType{
  13. NoShopping, // 无购买行为
  14. LittleShopping, // 仅购买特惠
  15. NormalShopping, // 正常消费
  16. LotShopping // 土豪
  17. };
  18. class IAPUserData {
  19. public:
  20. static IAPUserData* getInstance();
  21. void init();
  22. // 添加购买信息
  23. // 参数说明 : 商品id
  24. void addBuyInfo(std::string commodityID);
  25. // 获取用户类型
  26. UserBuyType getUserBuyType();
  27. private:
  28. private:
  29. static IAPUserData* _instance;
  30. std::vector<std::string> buyInfos; // 用户购买信息
  31. };
  32. NS_IAP_END
  33. #endif /* IAPUserData_hpp */