|
@@ -13,41 +13,32 @@
|
|
#include "IAPDefine.hpp"
|
|
#include "IAPDefine.hpp"
|
|
#include "IAPDelegate.hpp"
|
|
#include "IAPDelegate.hpp"
|
|
|
|
|
|
-#include "PBConfigData.hpp"
|
|
|
|
|
|
|
|
class IAPConf;
|
|
class IAPConf;
|
|
class IAPCtlShopUI;
|
|
class IAPCtlShopUI;
|
|
|
|
+class PBConfigData;
|
|
|
|
|
|
NS_IAP_BEGIN
|
|
NS_IAP_BEGIN
|
|
|
|
|
|
-enum UserBuyType{
|
|
|
|
- NoShopping, // 无购买行为
|
|
|
|
- LittleShopping, // 仅购买特惠
|
|
|
|
- NormalShopping, // 正常消费
|
|
|
|
- LotShopping // 土豪
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
class IAPCtlShop : public cocos2d::Ref {
|
|
class IAPCtlShop : public cocos2d::Ref {
|
|
public:
|
|
public:
|
|
// 创建一个商店控制器
|
|
// 创建一个商店控制器
|
|
static IAPCtlShop* createWith();
|
|
static IAPCtlShop* createWith();
|
|
-
|
|
|
|
- // 初始化
|
|
|
|
- // cfgFN 配置文件名
|
|
|
|
- void init(std::string& cfgFN);
|
|
|
|
|
|
|
|
// 设置代理
|
|
// 设置代理
|
|
// delegate 代理的实现
|
|
// delegate 代理的实现
|
|
void setDelegate(IAPDelegate* delegate);
|
|
void setDelegate(IAPDelegate* delegate);
|
|
|
|
|
|
|
|
+ // 初始化普通商店卡片配置
|
|
|
|
+ // cfgFN 配置文件名
|
|
|
|
+ void init(std::string& cfgFN);
|
|
|
|
+
|
|
// 设置失败时内购卡片的配置
|
|
// 设置失败时内购卡片的配置
|
|
|
|
+ // cfgFN 配置文件名
|
|
void setCfg4Failure(std::string& cfgFN);
|
|
void setCfg4Failure(std::string& cfgFN);
|
|
-
|
|
|
|
- // 显示失败时的内购卡片
|
|
|
|
- void displayFailureCardIn(cocos2d::Node*, std::vector<std::string> cardsName);
|
|
|
|
|
|
|
|
// 设置当前设备的等级
|
|
// 设置当前设备的等级
|
|
- // level 等级: 1 表示初级, 2 表示中级, 3 表示高级
|
|
|
|
|
|
+ // level 等级: 1 表示初级, 2 表示中级, 3 表示高级 (中级目前没有设计)
|
|
void setDeviceLevel(int level);
|
|
void setDeviceLevel(int level);
|
|
|
|
|
|
// 添加一个商店版位
|
|
// 添加一个商店版位
|
|
@@ -67,31 +58,30 @@ public:
|
|
// 清空活动
|
|
// 清空活动
|
|
void clearPlacement();
|
|
void clearPlacement();
|
|
|
|
|
|
- // 获取活动礼包总数
|
|
|
|
|
|
+ // 获取活动版位总数
|
|
size_t getPlacementCount();
|
|
size_t getPlacementCount();
|
|
|
|
|
|
- // 在某个节点中显示
|
|
|
|
|
|
+ // 在某个节点中打开普通商店
|
|
// pParent 父节点
|
|
// pParent 父节点
|
|
// requirement 对商店的要求,比如说最低金币数
|
|
// requirement 对商店的要求,比如说最低金币数
|
|
void showInNode(cocos2d::Node* pParent, ShopRequirement& requirement);
|
|
void showInNode(cocos2d::Node* pParent, ShopRequirement& requirement);
|
|
|
|
|
|
- // 以滑动卡片的形式在某个节点中显示满足金币条件的所有商店卡片
|
|
|
|
|
|
+ // 显示失败时的内购卡片(失败时卡片,非普通商店卡片)
|
|
|
|
+ // Node 父节点
|
|
|
|
+ // cardsName 内购卡片名称
|
|
|
|
+ void displayFailureCardIn(cocos2d::Node*, std::vector<std::string> cardsName);
|
|
|
|
+
|
|
|
|
+ // 以滑动卡片的形式在某个节点中显示满足金币条件的所有 普通商店卡片(暂未使用)删除?
|
|
// pParent 父节点
|
|
// pParent 父节点
|
|
// stillNeedCoins 距离所需要的金币数还差多少金币
|
|
// stillNeedCoins 距离所需要的金币数还差多少金币
|
|
void showSlideCardsByCoinsIn(cocos2d::Node* pParent, int stillNeedCoins);
|
|
void showSlideCardsByCoinsIn(cocos2d::Node* pParent, int stillNeedCoins);
|
|
|
|
|
|
- // 获取用户类型
|
|
|
|
- UserBuyType getUserBuyType();
|
|
|
|
-
|
|
|
|
// 添加用户购买信息 并 从delegate发送购买的道具信息
|
|
// 添加用户购买信息 并 从delegate发送购买的道具信息
|
|
void addUserBuyInfo(std::string commodityID);
|
|
void addUserBuyInfo(std::string commodityID);
|
|
|
|
|
|
// 清除用户购买信息
|
|
// 清除用户购买信息
|
|
void clearUserBuyInfo();
|
|
void clearUserBuyInfo();
|
|
|
|
|
|
- // 获取用户购买过的最贵礼包金额
|
|
|
|
- float getUserBuyMaxAmount();
|
|
|
|
-
|
|
|
|
private:
|
|
private:
|
|
|
|
|
|
|
|
|