IAPDefine.hpp 763 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // IAPDefine.hpp
  3. // TileManor
  4. //
  5. // Created by 徐炼新 on 2024/9/30.
  6. //
  7. #ifndef IAPDefine_h
  8. #define IAPDefine_h
  9. #include <string>
  10. #include <vector>
  11. #include "cocos2d.h"
  12. #define NS_IAP_BEGIN namespace iap {
  13. #define NS_IAP_END }
  14. NS_IAP_BEGIN
  15. // 卡片的实例
  16. class IAPCard {
  17. public:
  18. // 创建一个实例节点
  19. virtual Node* create() = 0;
  20. // 设置点击回调
  21. virtual void setCbWhileClicked(std::function<void()> cb) = 0;
  22. // 释放
  23. virtual void release() = 0;
  24. };
  25. // 在商店中的一个活动版位
  26. typedef struct {
  27. std::string id;
  28. std::vector<IAPCard*> cards;
  29. } IAPPlacement;
  30. // 显示商店时的一些要求
  31. typedef struct {
  32. int coinsMin;
  33. } ShopRequirement;
  34. NS_IAP_END
  35. #endif /* IAPDefine_h */