12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // IAPDefine.hpp
- // TileManor
- //
- // Created by 徐炼新 on 2024/9/30.
- //
- #ifndef IAPDefine_h
- #define IAPDefine_h
- #include <string>
- #include <vector>
- #include "cocos2d.h"
- #define NS_IAPSHOP_BEGIN namespace iapshop {
- #define NS_IAPSHOP_END }
- NS_IAPSHOP_BEGIN
- // 卡片的实例
- class IAPCard {
- public:
- // 创建一个实例节点
- virtual Node* create() = 0;
-
- // 设置点击回调
- virtual void setCbWhileClicked(std::function<void()> cb) = 0;
-
- // 释放
- virtual void release() = 0;
-
- // 获取卡片大小
- virtual cocos2d::Size getSize() = 0;
- };
- // 在商店中的一个活动版位
- typedef struct {
- std::string id;
- std::vector<IAPCard*> cards;
-
- std::string priority; // 活动优先级
- } IAPPlacement;
- // 显示商店时的一些要求
- typedef struct {
- int coinsMin;
- } ShopRequirement;
- NS_IAPSHOP_END
- #endif /* IAPDefine_h */
|