1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- //
- // IAPUserData.cpp
- // TileManor
- //
- // Created by 徐炼新 on 2024/9/30.
- //
- #include "IAPUserData.hpp"
- #include "IAPConf.hpp"
- NS_IAP_BEGIN
- IAPUserData* IAPUserData::_instance = nullptr;
- IAPUserData* IAPUserData::getInstance(){
- if(!_instance){
- _instance = new IAPUserData();
- }
- return _instance;
- }
- IAPUserData::IAPUserData(){
- init();
- }
- void IAPUserData::init(){
- // 提取用户本地购买信息
-
- }
- void IAPUserData::addBuyInfo(std::string commodityID){
- _buyInfos.push_back(commodityID);
-
- }
- void IAPUserData::addBuyInfo(std::vector<std::string> commodityIDs){
- for(const auto& commodityID : commodityIDs){
- addBuyInfo(commodityID);
- }
- }
- std::vector<std::string> IAPUserData::getBuyInfos(){
- return _buyInfos;
- }
- void IAPUserData::clearBuyInfo(){
- _buyInfos.clear();
- }
- NS_IAP_END
|