IAPUserData.cpp 697 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // IAPUserData.cpp
  3. // TileManor
  4. //
  5. // Created by 徐炼新 on 2024/9/30.
  6. //
  7. #include "IAPUserData.hpp"
  8. #include "IAPConf.hpp"
  9. NS_IAP_BEGIN
  10. IAPUserData* IAPUserData::_instance = nullptr;
  11. IAPUserData* IAPUserData::getInstance(){
  12. if(!_instance){
  13. _instance = new IAPUserData();
  14. }
  15. return _instance;
  16. }
  17. void IAPUserData::init(){
  18. }
  19. void IAPUserData::addBuyInfo(std::string commodityID){
  20. _buyInfos.push_back(commodityID);
  21. }
  22. void IAPUserData::addBuyInfo(std::vector<std::string> commodityIDs){
  23. for(const auto& commodityID : commodityIDs){
  24. _buyInfos.push_back(commodityID);
  25. }
  26. }
  27. void IAPUserData::clearBuyInfo(){
  28. _buyInfos.clear();
  29. }
  30. NS_IAP_END